Update model HF download
Browse files- Dockerfile +5 -5
- infer_onnx.py +4 -3
Dockerfile
CHANGED
@@ -40,11 +40,11 @@ COPY --chown=user requirements.txt $HOME/app/
|
|
40 |
|
41 |
RUN pip install -r requirements.txt
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
RUN huggingface-cli download BSC-LT/
|
46 |
-
|
47 |
-
RUN huggingface-cli download BSC-LT/vocos-mel-22khz-cat config.yaml --local-dir $HOME/app/
|
48 |
|
49 |
COPY --chown=user . $HOME/app/
|
50 |
|
|
|
40 |
|
41 |
RUN pip install -r requirements.txt
|
42 |
|
43 |
+
# download from inference script
|
44 |
+
#RUN huggingface-cli download BSC-LT/matcha-tts-cat-multispeaker matcha_multispeaker_cat_opset_15_10_steps_2399.onnx --local-dir $HOME/app/
|
45 |
+
#RUN huggingface-cli download BSC-LT/matcha-tts-cat-multispeaker config.yaml --local-dir $HOME/app/
|
46 |
+
#RUN huggingface-cli download BSC-LT/vocos-mel-22khz-cat mel_spec_22khz_cat.onnx --local-dir $HOME/app/
|
47 |
+
#RUN huggingface-cli download BSC-LT/vocos-mel-22khz-cat config.yaml --local-dir $HOME/app/
|
48 |
|
49 |
COPY --chown=user . $HOME/app/
|
50 |
|
infer_onnx.py
CHANGED
@@ -10,6 +10,7 @@ import tempfile
|
|
10 |
import yaml
|
11 |
import json
|
12 |
|
|
|
13 |
from time import perf_counter
|
14 |
|
15 |
def intersperse(lst, item):
|
@@ -30,10 +31,10 @@ def process_text(i: int, text: str, device: torch.device):
|
|
30 |
print(x_phones)
|
31 |
return x.numpy(), x_lengths.numpy()
|
32 |
|
33 |
-
MODEL_PATH_MATCHA_MEL="
|
34 |
MODEL_PATH_MATCHA="matcha_hifigan_multispeaker_cat.onnx"
|
35 |
-
MODEL_PATH_VOCOS="mel_spec_22khz_cat.onnx"
|
36 |
-
CONFIG_PATH="config.yaml"
|
37 |
SPEAKER_ID_DICT="spk_to_id.json"
|
38 |
|
39 |
sess_options = onnxruntime.SessionOptions()
|
|
|
10 |
import yaml
|
11 |
import json
|
12 |
|
13 |
+
from huggingface_hub import hf_hub_download
|
14 |
from time import perf_counter
|
15 |
|
16 |
def intersperse(lst, item):
|
|
|
31 |
print(x_phones)
|
32 |
return x.numpy(), x_lengths.numpy()
|
33 |
|
34 |
+
MODEL_PATH_MATCHA_MEL=hf_hub_download(repo_id="BSC-LT/matcha-tts-cat-multispeaker", filename="matcha_multispeaker_cat_opset_15_10_steps_2399.onnx")
|
35 |
MODEL_PATH_MATCHA="matcha_hifigan_multispeaker_cat.onnx"
|
36 |
+
MODEL_PATH_VOCOS=hf_hub_download(repo_id="BSC-LT/vocos-mel-22khz-cat", filename="mel_spec_22khz_cat.onnx")
|
37 |
+
CONFIG_PATH=hf_hub_download(repo_id="BSC-LT/vocos-mel-22khz-cat", filename="config.yaml")
|
38 |
SPEAKER_ID_DICT="spk_to_id.json"
|
39 |
|
40 |
sess_options = onnxruntime.SessionOptions()
|