Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -46,7 +46,7 @@ def generate_text(input_text, selected_model, history):
|
|
46 |
|
47 |
# Handle errors
|
48 |
if response.status_code != 200:
|
49 |
-
return f"Error: {response.status_code}, {response.text}", history
|
50 |
|
51 |
# Parse and generate the response
|
52 |
try:
|
@@ -58,8 +58,7 @@ def generate_text(input_text, selected_model, history):
|
|
58 |
# Append the new conversation to the history
|
59 |
history += f"User: {input_text}\nModel: {selected_model}\nResponse: {generated_response}\n\n"
|
60 |
|
61 |
-
return generated_response, history
|
62 |
-
|
63 |
|
64 |
# Create Gradio interface with a dropdown for model selection
|
65 |
iface = gr.Interface(
|
|
|
46 |
|
47 |
# Handle errors
|
48 |
if response.status_code != 200:
|
49 |
+
return f"Error: {response.status_code}, {response.text}", history, history
|
50 |
|
51 |
# Parse and generate the response
|
52 |
try:
|
|
|
58 |
# Append the new conversation to the history
|
59 |
history += f"User: {input_text}\nModel: {selected_model}\nResponse: {generated_response}\n\n"
|
60 |
|
61 |
+
return generated_response, history, history # Return three values
|
|
|
62 |
|
63 |
# Create Gradio interface with a dropdown for model selection
|
64 |
iface = gr.Interface(
|