Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -43,10 +43,10 @@ def respond(message, history, system_message, max_tokens, temperature, top_p):
|
|
43 |
messages.append({"role": "user", "content": message})
|
44 |
|
45 |
response = ""
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
|
51 |
# Generate Speech from Text (CPU Mode)
|
52 |
tts_audio_path = "tts_output.wav"
|
@@ -56,13 +56,13 @@ def respond(message, history, system_message, max_tokens, temperature, top_p):
|
|
56 |
rvc_audio_path = "rvc_output.wav"
|
57 |
rvc_converted_path = convert_voice(tts_audio_path, rvc_audio_path)
|
58 |
|
59 |
-
|
60 |
|
61 |
# Gradio UI
|
62 |
with gr.Blocks() as demo:
|
63 |
gr.Markdown("## DeepSeek R1 7B Chatbot with ZeldaBotW Voice (CPU Mode)")
|
64 |
|
65 |
-
chatbot = gr.Chatbot()
|
66 |
msg = gr.Textbox(label="User Input")
|
67 |
|
68 |
system_msg = gr.Textbox(value="You are a friendly Chatbot.", label="System Message")
|
|
|
43 |
messages.append({"role": "user", "content": message})
|
44 |
|
45 |
response = ""
|
46 |
+
|
47 |
+
# Get LLM Response
|
48 |
+
for message in client.chat_completion(messages, max_tokens=max_tokens, stream=False, temperature=temperature, top_p=top_p):
|
49 |
+
response += message.choices[0].message.content
|
50 |
|
51 |
# Generate Speech from Text (CPU Mode)
|
52 |
tts_audio_path = "tts_output.wav"
|
|
|
56 |
rvc_audio_path = "rvc_output.wav"
|
57 |
rvc_converted_path = convert_voice(tts_audio_path, rvc_audio_path)
|
58 |
|
59 |
+
return response, tts_audio_path, rvc_converted_path # ✅ Now correctly returns all outputs
|
60 |
|
61 |
# Gradio UI
|
62 |
with gr.Blocks() as demo:
|
63 |
gr.Markdown("## DeepSeek R1 7B Chatbot with ZeldaBotW Voice (CPU Mode)")
|
64 |
|
65 |
+
chatbot = gr.Chatbot(type="messages") # ✅ Fix deprecated type warning
|
66 |
msg = gr.Textbox(label="User Input")
|
67 |
|
68 |
system_msg = gr.Textbox(value="You are a friendly Chatbot.", label="System Message")
|