Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,17 +15,17 @@ def chatbot(input_text):
|
|
| 15 |
predicted_class = logits.argmax(-1)[0]
|
| 16 |
|
| 17 |
# Generate response based on predicted class
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
|
| 25 |
return response
|
| 26 |
|
| 27 |
# Create Gradio interface
|
| 28 |
-
|
| 29 |
fn=chatbot,
|
| 30 |
inputs="text",
|
| 31 |
outputs="text",
|
|
@@ -34,4 +34,4 @@ demo = gr.Interface(
|
|
| 34 |
)
|
| 35 |
|
| 36 |
# Launch Gradio app
|
| 37 |
-
|
|
|
|
| 15 |
predicted_class = logits.argmax(-1)[0]
|
| 16 |
|
| 17 |
# Generate response based on predicted class
|
| 18 |
+
responses = [
|
| 19 |
+
"I'm happy to help you with that!",
|
| 20 |
+
"I'm not sure I understand. Can you please rephrase?",
|
| 21 |
+
"I'm sorry, I'm not trained to respond to that."
|
| 22 |
+
]
|
| 23 |
+
response = responses[predicted_class]
|
| 24 |
|
| 25 |
return response
|
| 26 |
|
| 27 |
# Create Gradio interface
|
| 28 |
+
iface = gr.Interface(
|
| 29 |
fn=chatbot,
|
| 30 |
inputs="text",
|
| 31 |
outputs="text",
|
|
|
|
| 34 |
)
|
| 35 |
|
| 36 |
# Launch Gradio app
|
| 37 |
+
iface.launch()
|