dharsh1064 commited on
Commit
1d3f41c
·
verified ·
1 Parent(s): f0d37f8

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py ADDED
@@ -0,0 +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()