Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
-
import os
|
4 |
import spaces
|
5 |
import logging
|
6 |
from huggingface_hub import login
|
7 |
|
|
|
|
|
|
|
|
|
8 |
# Set up logging
|
9 |
logging.basicConfig(level=logging.INFO)
|
10 |
logger = logging.getLogger(__name__)
|
@@ -141,7 +153,6 @@ def build_interface():
|
|
141 |
|
142 |
with gr.Row():
|
143 |
with gr.Column(scale=2):
|
144 |
-
# Input section
|
145 |
text_input = gr.Textbox(
|
146 |
label="📝 Bambara Text",
|
147 |
placeholder="Type your Bambara text here...",
|
@@ -229,23 +240,14 @@ def build_interface():
|
|
229 |
outputs=[text_input, speaker_dropdown, use_advanced, temperature, top_k, top_p, max_tokens]
|
230 |
)
|
231 |
|
232 |
-
# Information section
|
233 |
with gr.Accordion("ℹ️ About", open=False):
|
234 |
gr.Markdown("""
|
235 |
**⚠️ This is an experimental Bambara TTS model.**
|
236 |
|
237 |
- **Model**: Based on SparkTTS architecture with BiCodec
|
238 |
-
- **Languages**: Bambara (bm)
|
239 |
- **Speakers**: 5 different voice options
|
240 |
- **Sample Rate**: 16kHz
|
241 |
-
- **Architecture**: Neural codec with semantic and global tokens
|
242 |
-
|
243 |
-
## 🚀 How to Use
|
244 |
-
|
245 |
-
1. **Enter Text**: Type your Bambara text in the input box
|
246 |
-
2. **Choose Speaker**: Select from 5 available voice options
|
247 |
-
3. **Advanced Settings**: Optionally adjust generation parameters
|
248 |
-
4. **Generate**: Click the generate button to create speech
|
249 |
""")
|
250 |
|
251 |
def toggle_advanced(use_adv):
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
+
# Set environment variables to disable compilation and optimize PyTorch
|
4 |
+
os.environ["TORCHDYNAMO_DISABLE"] = "1"
|
5 |
+
os.environ["TORCH_COMPILE_DISABLE"] = "1"
|
6 |
+
os.environ["PYTORCH_DISABLE_CUDNN_BENCHMARK"] = "1"
|
7 |
+
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
8 |
+
|
9 |
+
import torch
|
10 |
import gradio as gr
|
11 |
import numpy as np
|
|
|
12 |
import spaces
|
13 |
import logging
|
14 |
from huggingface_hub import login
|
15 |
|
16 |
+
# Disable PyTorch compilation completely
|
17 |
+
torch._dynamo.config.disable = True
|
18 |
+
torch._dynamo.config.suppress_errors = True
|
19 |
+
|
20 |
# Set up logging
|
21 |
logging.basicConfig(level=logging.INFO)
|
22 |
logger = logging.getLogger(__name__)
|
|
|
153 |
|
154 |
with gr.Row():
|
155 |
with gr.Column(scale=2):
|
|
|
156 |
text_input = gr.Textbox(
|
157 |
label="📝 Bambara Text",
|
158 |
placeholder="Type your Bambara text here...",
|
|
|
240 |
outputs=[text_input, speaker_dropdown, use_advanced, temperature, top_k, top_p, max_tokens]
|
241 |
)
|
242 |
|
|
|
243 |
with gr.Accordion("ℹ️ About", open=False):
|
244 |
gr.Markdown("""
|
245 |
**⚠️ This is an experimental Bambara TTS model.**
|
246 |
|
247 |
- **Model**: Based on SparkTTS architecture with BiCodec
|
248 |
+
- **Languages**: Bambara (bm)
|
249 |
- **Speakers**: 5 different voice options
|
250 |
- **Sample Rate**: 16kHz
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
""")
|
252 |
|
253 |
def toggle_advanced(use_adv):
|