Spaces:
Running on Zero
Running on Zero
Return to gradio 5.28.0 with pyharp v0.3.0: this stack cannot take huggingface-hub 1.x
Browse files- README.md +1 -1
- app.py +31 -36
- requirements.txt +4 -4
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 🗣️
|
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: other
|
|
|
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 5.28.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: other
|
app.py
CHANGED
|
@@ -9,7 +9,6 @@ from pathlib import Path
|
|
| 9 |
import gradio as gr
|
| 10 |
import spaces
|
| 11 |
from pyharp import ModelCard, build_endpoint
|
| 12 |
-
from pyharp.tags import Subcategory
|
| 13 |
|
| 14 |
ROOT = Path(__file__).resolve().parent
|
| 15 |
sys.path.append(str(ROOT / "indextts"))
|
|
@@ -53,40 +52,36 @@ def synthesize(text, voice_reference, emotion_reference, emotion_weight):
|
|
| 53 |
raise gr.Error(f"IndexTTS2 synthesis failed: {exc}") from exc
|
| 54 |
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
),
|
| 86 |
-
input_components=input_components,
|
| 87 |
-
output_components=output_components,
|
| 88 |
-
process_fn=synthesize,
|
| 89 |
-
)
|
| 90 |
|
| 91 |
|
| 92 |
-
|
|
|
|
|
|
| 9 |
import gradio as gr
|
| 10 |
import spaces
|
| 11 |
from pyharp import ModelCard, build_endpoint
|
|
|
|
| 12 |
|
| 13 |
ROOT = Path(__file__).resolve().parent
|
| 14 |
sys.path.append(str(ROOT / "indextts"))
|
|
|
|
| 52 |
raise gr.Error(f"IndexTTS2 synthesis failed: {exc}") from exc
|
| 53 |
|
| 54 |
|
| 55 |
+
with gr.Blocks(title="IndexTTS2") as demo:
|
| 56 |
+
input_components = [
|
| 57 |
+
gr.Textbox(label="Text to Synthesize", lines=3).set_info(
|
| 58 |
+
"Chinese or English text to synthesize."
|
| 59 |
+
),
|
| 60 |
+
gr.Audio(type="filepath", label="Voice Reference").set_info(
|
| 61 |
+
"Required voice sample; the model uses up to 15 seconds."
|
| 62 |
+
),
|
| 63 |
+
gr.Audio(type="filepath", label="Emotion Reference")
|
| 64 |
+
.harp_required(False)
|
| 65 |
+
.set_info("Optional. Leave empty to follow the voice reference."),
|
| 66 |
+
gr.Slider(0.0, 1.0, value=0.8, step=0.05, label="Emotion Weight").set_info(
|
| 67 |
+
"Strength of the optional emotion reference."
|
| 68 |
+
),
|
| 69 |
+
]
|
| 70 |
+
output_components = [
|
| 71 |
+
gr.Audio(type="filepath", label="Output Audio").set_info("Generated WAV audio."),
|
| 72 |
+
]
|
| 73 |
+
build_endpoint(
|
| 74 |
+
model_card=ModelCard(
|
| 75 |
+
name="IndexTTS2",
|
| 76 |
+
description="Zero-shot speech synthesis with a voice reference and optional emotion reference.",
|
| 77 |
+
author="IndexTeam",
|
| 78 |
+
tags=["text-to-speech", "voice-cloning", "emotion-control"],
|
| 79 |
+
),
|
| 80 |
+
input_components=input_components,
|
| 81 |
+
output_components=output_components,
|
| 82 |
+
process_fn=synthesize,
|
| 83 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
|
| 86 |
+
if __name__ == "__main__":
|
| 87 |
+
demo.queue(default_concurrency_limit=1).launch(show_error=True, pwa=True)
|
requirements.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
accelerate==1.8.1
|
| 2 |
descript-audiotools==0.7.2
|
| 3 |
-
transformers==
|
| 4 |
-
tokenizers
|
| 5 |
cn2an==0.5.22
|
| 6 |
ffmpeg-python==0.2.0
|
| 7 |
Cython==3.0.7
|
|
@@ -17,7 +17,7 @@ munch==4.0.0
|
|
| 17 |
opencv-python==4.9.0.80
|
| 18 |
tensorboard==2.9.1
|
| 19 |
librosa==0.10.2.post1
|
| 20 |
-
safetensors
|
| 21 |
deepspeed==0.17.1
|
| 22 |
modelscope==1.27.0
|
| 23 |
omegaconf
|
|
@@ -31,4 +31,4 @@ torchaudio==2.8.0
|
|
| 31 |
|
| 32 |
WeTextProcessing; platform_machine != "Darwin"
|
| 33 |
wetext; platform_system == "Darwin"
|
| 34 |
-
git+https://github.com/TEAMuP-dev/pyharp.git@v0.
|
|
|
|
| 1 |
accelerate==1.8.1
|
| 2 |
descript-audiotools==0.7.2
|
| 3 |
+
transformers==4.52.4
|
| 4 |
+
tokenizers==0.21.0
|
| 5 |
cn2an==0.5.22
|
| 6 |
ffmpeg-python==0.2.0
|
| 7 |
Cython==3.0.7
|
|
|
|
| 17 |
opencv-python==4.9.0.80
|
| 18 |
tensorboard==2.9.1
|
| 19 |
librosa==0.10.2.post1
|
| 20 |
+
safetensors==0.5.2
|
| 21 |
deepspeed==0.17.1
|
| 22 |
modelscope==1.27.0
|
| 23 |
omegaconf
|
|
|
|
| 31 |
|
| 32 |
WeTextProcessing; platform_machine != "Darwin"
|
| 33 |
wetext; platform_system == "Darwin"
|
| 34 |
+
git+https://github.com/TEAMuP-dev/pyharp.git@v0.3.0
|