Spaces:
Runtime error
Runtime error
Commit Β·
fd1c268
1
Parent(s): 5f09150
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
import torch
|
| 3 |
from tabs.FACS_analysis import create_facs_analysis_tab
|
| 4 |
from ui_components import CUSTOM_CSS, HEADER_HTML, DISCLAIMER_HTML
|
| 5 |
-
import spaces # Importing spaces to utilize GPU
|
| 6 |
|
| 7 |
import logging
|
| 8 |
|
|
@@ -16,8 +16,6 @@ TAB_STRUCTURE = [
|
|
| 16 |
])
|
| 17 |
]
|
| 18 |
|
| 19 |
-
# Decorate GPU-dependent function with GPU
|
| 20 |
-
@spaces.GPU(duration=300) # Increased duration if necessary
|
| 21 |
def create_demo():
|
| 22 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 23 |
logger.info(f"Using device: {device}")
|
|
@@ -36,7 +34,7 @@ def create_demo():
|
|
| 36 |
|
| 37 |
return demo
|
| 38 |
|
| 39 |
-
# Create the demo instance
|
| 40 |
demo = create_demo()
|
| 41 |
|
| 42 |
if __name__ == "__main__":
|
|
|
|
| 2 |
import torch
|
| 3 |
from tabs.FACS_analysis import create_facs_analysis_tab
|
| 4 |
from ui_components import CUSTOM_CSS, HEADER_HTML, DISCLAIMER_HTML
|
| 5 |
+
import spaces # Importing spaces to utilize GPU if available
|
| 6 |
|
| 7 |
import logging
|
| 8 |
|
|
|
|
| 16 |
])
|
| 17 |
]
|
| 18 |
|
|
|
|
|
|
|
| 19 |
def create_demo():
|
| 20 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 21 |
logger.info(f"Using device: {device}")
|
|
|
|
| 34 |
|
| 35 |
return demo
|
| 36 |
|
| 37 |
+
# Create the demo instance without GPU decorator
|
| 38 |
demo = create_demo()
|
| 39 |
|
| 40 |
if __name__ == "__main__":
|