SpawnedShoyo commited on
Commit
1bfd482
·
verified ·
1 Parent(s): 12e37db

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipeline = pipeline(task="text-generation", model="starcoder2-15b")
5
+
6
+ def chatbot(input_text):
7
+ generated_text = pipeline(input_text, max_length=50)
8
+ return input_text, "Chatbot: " + generated_text[0]["generated_text"]
9
+
10
+ chatbot_app = gr.Interface(
11
+ chatbot,
12
+ inputs=gr.Textbox(lines=2, label="You:"),
13
+ outputs=gr.Textbox(label="Chatbot:", placeholder="Chatbot's response will appear here..."),
14
+ title="Chatbot UI"
15
+ )
16
+
17
+ if __name__ == "__main__":
18
+ chatbot_app.launch()