Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,7 +31,27 @@ def respond(message, history):
|
|
| 31 |
print(response)
|
| 32 |
|
| 33 |
#return response ['choices'][0]['message']['content'].strip()
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
chatbot.launch(debug=True)
|
|
|
|
| 31 |
print(response)
|
| 32 |
|
| 33 |
#return response ['choices'][0]['message']['content'].strip()
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
if message:
|
| 38 |
+
output_text = f"You entered: '{input_text}'. This is processed output."
|
| 39 |
+
else:
|
| 40 |
+
response = "Please enter some text in the input box."
|
| 41 |
+
return responses
|
| 42 |
+
|
| 43 |
+
# Create the Gradio Interface
|
| 44 |
+
iface = gr.Interface(
|
| 45 |
+
fn=process_text,
|
| 46 |
+
inputs=gr.Textbox(lines=5, label="Input Text", placeholder="Type something here..."),
|
| 47 |
+
outputs=gr.Textbox(lines=5, label="Output Text"),
|
| 48 |
+
title="My Simple Text Processing Space",
|
| 49 |
+
description="Enter text in the input box and see the processed output."
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
# Launch the app
|
| 53 |
+
if __name__ == "__main__':
|
| 54 |
+
iface.launch()
|
| 55 |
+
chatbot = gr.ChatInterface(respond, type = "messages", theme = "shivi/calm_seafoam")
|
| 56 |
|
| 57 |
chatbot.launch(debug=True)
|