thunnai commited on
Commit
e8fceff
·
1 Parent(s): 9fbd8c2

test with forced pytorch

Browse files
Files changed (2) hide show
  1. README.md +3 -3
  2. app.py +2 -9
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
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
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
- if importlib.util.find_spec("mlx") is not None:
15
- from nanospeech.nanospeech_mlx import Nanospeech
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: