Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -108,20 +108,19 @@ def generate(
|
|
| 108 |
# Continue the conversation and yield the output
|
| 109 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
| 110 |
output = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
-
|
| 113 |
-
# Check if the checkbox is selected and the correct password is provided
|
| 114 |
if enable_tts and tts_password == ttsPassword:
|
| 115 |
# Generate the audio file
|
| 116 |
audio = elevenlabs.generate(response, voice, model, api_key=elevenlabsKey)
|
| 117 |
|
| 118 |
# Play the audio file
|
| 119 |
elevenlabs.play(audio)
|
| 120 |
-
|
| 121 |
-
for response in stream:
|
| 122 |
-
output += response.token.text
|
| 123 |
-
yield output
|
| 124 |
-
return output
|
| 125 |
|
| 126 |
mychatbot = gr.Chatbot(
|
| 127 |
avatar_images=["./user.png", "./stella.jpg"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True)
|
|
|
|
| 108 |
# Continue the conversation and yield the output
|
| 109 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
| 110 |
output = ""
|
| 111 |
+
|
| 112 |
+
for response in stream:
|
| 113 |
+
output += response.token.text
|
| 114 |
+
yield output
|
| 115 |
+
return output
|
| 116 |
|
| 117 |
+
# Check if the checkbox is selected and the correct password is provided
|
|
|
|
| 118 |
if enable_tts and tts_password == ttsPassword:
|
| 119 |
# Generate the audio file
|
| 120 |
audio = elevenlabs.generate(response, voice, model, api_key=elevenlabsKey)
|
| 121 |
|
| 122 |
# Play the audio file
|
| 123 |
elevenlabs.play(audio)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
mychatbot = gr.Chatbot(
|
| 126 |
avatar_images=["./user.png", "./stella.jpg"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True)
|