dharsh1064 commited on
Commit
ae2c48f
·
verified ·
1 Parent(s): 067c7be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -1,10 +1,10 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
 
4
- generator = pipeline("text-generation", model="tiiuae/falcon-7b-instruct")
 
 
 
 
5
 
6
- def chat(message):
7
- result = generator(message, max_new_tokens=100, do_sample=True)
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()