morisp commited on
Commit
390b438
·
verified ·
1 Parent(s): 31c5cfc

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
+ pipe = pipeline("text-generation", model="TinyLlama/TinyLlama-1.1B-Chat-v1.0")
5
+
6
+ def chat(message, history):
7
+ response = pipe(message, max_new_tokens=256)
8
+ return response[0]['generated_text']
9
+
10
+ gr.ChatInterface(chat).launch()