Spaces:
Running
on
Zero
Running
on
Zero
Add GPU decorator to run_inference function and import spaces module
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import os
|
|
| 3 |
import subprocess
|
| 4 |
import time
|
| 5 |
from typing import Dict, List, Optional, Tuple
|
| 6 |
-
|
| 7 |
import gradio as gr
|
| 8 |
import soundfile as sf
|
| 9 |
import torch
|
|
@@ -117,6 +117,7 @@ def _validate_condition_choices(condition_type: Optional[List[str]]) -> List[str
|
|
| 117 |
return condition_type
|
| 118 |
|
| 119 |
|
|
|
|
| 120 |
def run_inference(
|
| 121 |
prompt_text: str,
|
| 122 |
condition_audio: Optional[str],
|
|
|
|
| 3 |
import subprocess
|
| 4 |
import time
|
| 5 |
from typing import Dict, List, Optional, Tuple
|
| 6 |
+
import spaces
|
| 7 |
import gradio as gr
|
| 8 |
import soundfile as sf
|
| 9 |
import torch
|
|
|
|
| 117 |
return condition_type
|
| 118 |
|
| 119 |
|
| 120 |
+
@spaces.GPU
|
| 121 |
def run_inference(
|
| 122 |
prompt_text: str,
|
| 123 |
condition_audio: Optional[str],
|