Spaces:
Runtime error
Runtime error
test with forced pytorch
Browse files
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
title: Nanospeech
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: gray
|
| 5 |
colorTo: gray
|
| 6 |
sdk: gradio
|
|
@@ -8,7 +8,7 @@ sdk_version: 5.15.0
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
-
short_description: '(Unofficial) Demo of Nanospeech by lucasnewman
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
|
|
|
| 1 |
---
|
| 2 |
title: Nanospeech
|
| 3 |
+
emoji: 🎤
|
| 4 |
colorFrom: gray
|
| 5 |
colorTo: gray
|
| 6 |
sdk: gradio
|
|
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
+
short_description: '(Unofficial) Demo of Nanospeech by lucasnewman'
|
| 12 |
---
|
| 13 |
|
| 14 |
+
|
app.py
CHANGED
|
@@ -11,15 +11,8 @@ import numpy as np
|
|
| 11 |
from typing import Optional, Literal
|
| 12 |
import importlib.util
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
MODEL_RUNTIME = 'MLX'
|
| 17 |
-
elif importlib.util.find_spec("torch") is not None:
|
| 18 |
-
from nanospeech.nanospeech_torch import Nanospeech
|
| 19 |
-
MODEL_RUNTIME = 'Torch'
|
| 20 |
-
else:
|
| 21 |
-
raise ValueError("No model runtime found")
|
| 22 |
-
|
| 23 |
# Note: gradio expects audio as int16, so we need to convert to float32 when loading and convert back when returning
|
| 24 |
|
| 25 |
def convert_audio_int16_to_float32(audio: np.ndarray) -> np.ndarray:
|
|
|
|
| 11 |
from typing import Optional, Literal
|
| 12 |
import importlib.util
|
| 13 |
|
| 14 |
+
from nanospeech.nanospeech_torch import Nanospeech
|
| 15 |
+
MODEL_RUNTIME = 'Torch'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
# Note: gradio expects audio as int16, so we need to convert to float32 when loading and convert back when returning
|
| 17 |
|
| 18 |
def convert_audio_int16_to_float32(audio: np.ndarray) -> np.ndarray:
|