ggoknar
commited on
Commit
·
900bc63
1
Parent(s):
26b68c8
fix initial history, remove unnecessary comment
Browse files
app.py
CHANGED
|
@@ -352,13 +352,11 @@ def get_voice_streaming(prompt, language, latent_tuple, suffix="0"):
|
|
| 352 |
|
| 353 |
|
| 354 |
def get_sentence(history, system_prompt=""):
|
| 355 |
-
history = [] if history is None else history
|
| 356 |
-
|
| 357 |
if system_prompt == "":
|
| 358 |
system_prompt = system_message
|
| 359 |
|
| 360 |
-
history[-1][1] = ""
|
| 361 |
-
|
| 362 |
mistral_start = time.time()
|
| 363 |
print("Mistral start")
|
| 364 |
sentence_list = []
|
|
@@ -497,16 +495,7 @@ def generate_speech(history):
|
|
| 497 |
print("RuntimeError: non device-side assert error:", str(e))
|
| 498 |
raise e
|
| 499 |
|
| 500 |
-
|
| 501 |
-
# requires pip install ffmpeg-python
|
| 502 |
-
|
| 503 |
-
# files_to_concat= [ffmpeg.input(w) for w in wav_list]
|
| 504 |
-
# combined_file_name="combined.wav"
|
| 505 |
-
# ffmpeg.concat(*files_to_concat,v=0, a=1).output(combined_file_name).run(overwrite_output=True)
|
| 506 |
-
# final_audio.update(value=combined_file_name, visible=True)
|
| 507 |
-
# yield (combined_file_name, history
|
| 508 |
-
|
| 509 |
-
time.sleep(0.6)
|
| 510 |
wav_bytestream = wave_header_chunk() + wav_bytestream
|
| 511 |
outfile = "combined.wav"
|
| 512 |
with open(outfile, "wb") as f:
|
|
@@ -578,4 +567,4 @@ Note:
|
|
| 578 |
- By using this demo you agree to the terms of the Coqui Public Model License at https://coqui.ai/cpml"""
|
| 579 |
)
|
| 580 |
demo.queue()
|
| 581 |
-
demo.launch(debug=True)
|
|
|
|
| 352 |
|
| 353 |
|
| 354 |
def get_sentence(history, system_prompt=""):
|
| 355 |
+
history = [["", None]] if history is None else history
|
| 356 |
+
print(history)
|
| 357 |
if system_prompt == "":
|
| 358 |
system_prompt = system_message
|
| 359 |
|
|
|
|
|
|
|
| 360 |
mistral_start = time.time()
|
| 361 |
print("Mistral start")
|
| 362 |
sentence_list = []
|
|
|
|
| 495 |
print("RuntimeError: non device-side assert error:", str(e))
|
| 496 |
raise e
|
| 497 |
|
| 498 |
+
time.sleep(0.5)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 499 |
wav_bytestream = wave_header_chunk() + wav_bytestream
|
| 500 |
outfile = "combined.wav"
|
| 501 |
with open(outfile, "wb") as f:
|
|
|
|
| 567 |
- By using this demo you agree to the terms of the Coqui Public Model License at https://coqui.ai/cpml"""
|
| 568 |
)
|
| 569 |
demo.queue()
|
| 570 |
+
demo.launch(debug=True, share=True)
|