Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,6 +16,7 @@ from fastrtc import (
|
|
| 16 |
)
|
| 17 |
from huggingface_hub import InferenceClient
|
| 18 |
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
|
|
|
|
| 19 |
|
| 20 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 21 |
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
|
@@ -49,7 +50,7 @@ tts_model = get_tts_model()
|
|
| 49 |
|
| 50 |
conversations: dict[str, list[dict[str, str]]] = {}
|
| 51 |
|
| 52 |
-
|
| 53 |
def response(
|
| 54 |
audio: tuple[int, np.ndarray],
|
| 55 |
hf_token: str | None,
|
|
|
|
| 16 |
)
|
| 17 |
from huggingface_hub import InferenceClient
|
| 18 |
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
|
| 19 |
+
import spaces
|
| 20 |
|
| 21 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 22 |
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
|
|
|
| 50 |
|
| 51 |
conversations: dict[str, list[dict[str, str]]] = {}
|
| 52 |
|
| 53 |
+
@spaces.GPU
|
| 54 |
def response(
|
| 55 |
audio: tuple[int, np.ndarray],
|
| 56 |
hf_token: str | None,
|