test / app.py
lzting's picture
Create app.py
91180dc verified
raw
history blame contribute delete
303 Bytes
from transformers import pipeline
import gradio as gr
pipe = pipeline("text-generation", model="yentinglin/Taiwan-LLM-7B-v2.0.1-chat")
def chat_fn(prompt):
return pipe(prompt, max_new_tokens=200)[0]["generated_text"]
iface = gr.Interface(fn=chat_fn, inputs="text", outputs="text")
iface.launch()