Spaces:
Sleeping
Sleeping
Create app.py
Browse files
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()
|