CaiRou-Huang commited on
Commit
7858013
1 Parent(s): 29333ec

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipe = pipeline("text-generation", model="yentinglin/Taiwan-LLM-7B-v2.0-chat")
5
+
6
+ def predict(prompt):
7
+ completion = model(prompt)[0]["generated_text"]
8
+ return completion
9
+
10
+ iface = gr.Interface(fn=predict, inputs="text", outputs="text")
11
+ iface.launch()