Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,12 +3,9 @@ import wave
|
|
3 |
import numpy as np
|
4 |
from io import BytesIO
|
5 |
from huggingface_hub import hf_hub_download
|
6 |
-
from piper import PiperVoice
|
7 |
|
8 |
def synthesize_speech(text):
|
9 |
-
# Load the PiperVoice model and configuration
|
10 |
-
# model_path = "en_GB-alan-medium.onnx" # this is for loading local model
|
11 |
-
# config_path = "en_GB-alan-medium.onnx.json" # for loading local json
|
12 |
model_path = hf_hub_download(repo_id="rhasspy/piper-voices", filename="en/en_GB/alan/medium/en_GB-alan-medium.onnx")
|
13 |
config_path = hf_hub_download(repo_id="rhasspy/piper-voices", filename="en/en_GB/alan/medium/en_GB-alan-medium.onnx.json")
|
14 |
voice = PiperVoice.load(model_path, config_path)
|
|
|
3 |
import numpy as np
|
4 |
from io import BytesIO
|
5 |
from huggingface_hub import hf_hub_download
|
6 |
+
from piper import PiperVoice
|
7 |
|
8 |
def synthesize_speech(text):
|
|
|
|
|
|
|
9 |
model_path = hf_hub_download(repo_id="rhasspy/piper-voices", filename="en/en_GB/alan/medium/en_GB-alan-medium.onnx")
|
10 |
config_path = hf_hub_download(repo_id="rhasspy/piper-voices", filename="en/en_GB/alan/medium/en_GB-alan-medium.onnx.json")
|
11 |
voice = PiperVoice.load(model_path, config_path)
|