Update app.py
Browse files
app.py
CHANGED
@@ -3,9 +3,16 @@ import onnxruntime as ort
|
|
3 |
import torch
|
4 |
import scipy.io.wavfile as wav
|
5 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
# Load the ONNX model
|
8 |
-
model_path = "Kokoro-82M-ONNX/model.onnx"
|
9 |
ort_session = ort.InferenceSession(model_path)
|
10 |
|
11 |
# Define speaker options (replace with actual speaker IDs or embeddings)
|
|
|
3 |
import torch
|
4 |
import scipy.io.wavfile as wav
|
5 |
import gradio as gr
|
6 |
+
from huggingface_hub import hf_hub_download # Add this import
|
7 |
+
|
8 |
+
# Download the ONNX model from Hugging Face Hub
|
9 |
+
model_path = hf_hub_download(
|
10 |
+
repo_id="onnx-community/Kokoro-82M-ONNX",
|
11 |
+
filename="model.onnx",
|
12 |
+
cache_dir="."
|
13 |
+
)
|
14 |
|
15 |
# Load the ONNX model
|
|
|
16 |
ort_session = ort.InferenceSession(model_path)
|
17 |
|
18 |
# Define speaker options (replace with actual speaker IDs or embeddings)
|