Spaces:
Running
on
Zero
Running
on
Zero
debug code removed
Browse files- higgs_audio_utils.py +1 -11
higgs_audio_utils.py
CHANGED
|
@@ -234,11 +234,6 @@ def text_to_speech(
|
|
| 234 |
Tuple of (generated_text, (sample_rate, audio_data)) where audio_data is int16 numpy array
|
| 235 |
"""
|
| 236 |
|
| 237 |
-
print(f'text is={text}')
|
| 238 |
-
print(f'voice_preset is={voice_preset}')
|
| 239 |
-
print(f'reference_audio is={reference_audio}')
|
| 240 |
-
print(f'reference_text is={reference_text}')
|
| 241 |
-
|
| 242 |
try:
|
| 243 |
# Prepare ChatML sample
|
| 244 |
chatml_sample = prepare_chatml_sample(voice_preset, text, reference_audio, reference_text, system_prompt)
|
|
@@ -250,11 +245,7 @@ def text_to_speech(
|
|
| 250 |
stop_list = [s for s in stop_strings["stops"] if s.strip()]
|
| 251 |
|
| 252 |
request_id = f"tts-playground-{str(uuid.uuid4())}"
|
| 253 |
-
|
| 254 |
-
f"{request_id}: Generating speech for text: {text[:100]}..., \n"
|
| 255 |
-
f"with parameters: temperature={temperature}, top_p={top_p}, top_k={top_k}, stop_list={stop_list}, "
|
| 256 |
-
f"ras_win_len={ras_win_len}, ras_win_max_num_repeat={ras_win_max_num_repeat}"
|
| 257 |
-
)
|
| 258 |
start_time = time.time()
|
| 259 |
|
| 260 |
# Generate using the engine
|
|
@@ -270,7 +261,6 @@ def text_to_speech(
|
|
| 270 |
)
|
| 271 |
|
| 272 |
generation_time = time.time() - start_time
|
| 273 |
-
logger.info(f"{request_id}: Generated audio in {generation_time:.3f} seconds")
|
| 274 |
|
| 275 |
# Process the response
|
| 276 |
text_output = process_text_output(response.generated_text)
|
|
|
|
| 234 |
Tuple of (generated_text, (sample_rate, audio_data)) where audio_data is int16 numpy array
|
| 235 |
"""
|
| 236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
try:
|
| 238 |
# Prepare ChatML sample
|
| 239 |
chatml_sample = prepare_chatml_sample(voice_preset, text, reference_audio, reference_text, system_prompt)
|
|
|
|
| 245 |
stop_list = [s for s in stop_strings["stops"] if s.strip()]
|
| 246 |
|
| 247 |
request_id = f"tts-playground-{str(uuid.uuid4())}"
|
| 248 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
start_time = time.time()
|
| 250 |
|
| 251 |
# Generate using the engine
|
|
|
|
| 261 |
)
|
| 262 |
|
| 263 |
generation_time = time.time() - start_time
|
|
|
|
| 264 |
|
| 265 |
# Process the response
|
| 266 |
text_output = process_text_output(response.generated_text)
|