Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -29,6 +29,7 @@ app.mount("/static", StaticFiles(directory="static"), name="static")
|
|
29 |
# Tell Gradio which paths are allowed to be served
|
30 |
os.environ["GRADIO_ALLOWED_PATHS"] = str(static_dir.resolve())
|
31 |
|
|
|
32 |
def process_text(text):
|
33 |
"""Example GPU function - in reality, this might be model inference"""
|
34 |
time.sleep(10)
|
@@ -36,7 +37,6 @@ def process_text(text):
|
|
36 |
return text.upper()
|
37 |
|
38 |
|
39 |
-
@spaces.GPU(duration=2*60) # Specify GPU duration in seconds, added for testing
|
40 |
def process_and_save(request: gr.Request, text):
|
41 |
"""Main processing function that handles tokens and calls GPU function"""
|
42 |
# Get and decode the authentication token
|
|
|
29 |
# Tell Gradio which paths are allowed to be served
|
30 |
os.environ["GRADIO_ALLOWED_PATHS"] = str(static_dir.resolve())
|
31 |
|
32 |
+
@spaces.GPU(duration=2*60) # Specify GPU duration in seconds, added for testing
|
33 |
def process_text(text):
|
34 |
"""Example GPU function - in reality, this might be model inference"""
|
35 |
time.sleep(10)
|
|
|
37 |
return text.upper()
|
38 |
|
39 |
|
|
|
40 |
def process_and_save(request: gr.Request, text):
|
41 |
"""Main processing function that handles tokens and calls GPU function"""
|
42 |
# Get and decode the authentication token
|