Update app.py
Browse files
app.py
CHANGED
@@ -5,17 +5,17 @@ import numpy as np
|
|
5 |
from transformers import AutoTokenizer
|
6 |
import onnxruntime
|
7 |
import scipy.io.wavfile
|
|
|
8 |
|
9 |
-
#
|
10 |
-
|
11 |
-
model_dir = "Athspi/Gg"
|
12 |
|
13 |
-
#
|
14 |
-
|
15 |
-
onnx_model_path =
|
16 |
|
17 |
-
# Load the tokenizer from the
|
18 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
19 |
|
20 |
# Initialize the ONNX runtime session for inference.
|
21 |
ort_session = onnxruntime.InferenceSession(
|
|
|
5 |
from transformers import AutoTokenizer
|
6 |
import onnxruntime
|
7 |
import scipy.io.wavfile
|
8 |
+
from huggingface_hub import hf_hub_download
|
9 |
|
10 |
+
# Define the Hugging Face repository/model ID.
|
11 |
+
repo_id = "Athspi/Gg"
|
|
|
12 |
|
13 |
+
# Download the ONNX model file from the repository.
|
14 |
+
# This will download "mms_tts_eng.onnx" from: https://huggingface.co/Athspi/Gg/resolve/main/mms_tts_eng.onnx
|
15 |
+
onnx_model_path = hf_hub_download(repo_id=repo_id, filename="mms_tts_eng.onnx")
|
16 |
|
17 |
+
# Load the tokenizer from the repository.
|
18 |
+
tokenizer = AutoTokenizer.from_pretrained(repo_id)
|
19 |
|
20 |
# Initialize the ONNX runtime session for inference.
|
21 |
ort_session = onnxruntime.InferenceSession(
|