lzting commited on
Commit
91180dc
·
verified ·
1 Parent(s): f5d2116

Create app.py

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