Spaces:
Running
Running
Make the hardware a settings change, not a code change
Browse files
app.py
CHANGED
|
@@ -17,6 +17,7 @@ from pyharp.tags import Subcategory
|
|
| 17 |
|
| 18 |
from models.resunet import ResUNet30
|
| 19 |
from models.clap_encoder import CLAP_Encoder
|
|
|
|
| 20 |
|
| 21 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 22 |
|
|
@@ -85,6 +86,7 @@ model_card = ModelCard(
|
|
| 85 |
|
| 86 |
|
| 87 |
@torch.inference_mode()
|
|
|
|
| 88 |
def process_fn(audio_path: str, text_query: str):
|
| 89 |
if model_loading:
|
| 90 |
raise gr.Error("Model is still loading, please wait a moment and try again.")
|
|
|
|
| 17 |
|
| 18 |
from models.resunet import ResUNet30
|
| 19 |
from models.clap_encoder import CLAP_Encoder
|
| 20 |
+
import spaces
|
| 21 |
|
| 22 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 23 |
|
|
|
|
| 86 |
|
| 87 |
|
| 88 |
@torch.inference_mode()
|
| 89 |
+
@spaces.GPU(duration=120)
|
| 90 |
def process_fn(audio_path: str, text_query: str):
|
| 91 |
if model_loading:
|
| 92 |
raise gr.Error("Model is still loading, please wait a moment and try again.")
|