Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from transformers import pipeline
|
| 3 |
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
return result[0]["generated_text"]
|
| 9 |
-
|
| 10 |
-
gr.Interface(fn=chat, inputs="text", outputs="text", title="HackRx Chat API").launch()
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
+
def chat_fn(message):
|
| 4 |
+
# Simple logic or use your model
|
| 5 |
+
if "capital of Germany" in message:
|
| 6 |
+
return "Berlin"
|
| 7 |
+
return "I'm not sure, but I can try to help!"
|
| 8 |
|
| 9 |
+
iface = gr.Interface(fn=chat_fn, inputs="text", outputs="text")
|
| 10 |
+
iface.launch()
|
|
|
|
|
|
|
|
|