chatbot_sample / app.py
arjunanand13's picture
Update app.py
3da5f02 verified
Raw
History Blame Contribute Delete
334 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline(
"text-generation",
model="microsoft/Phi-3-mini-4k-instruct"
)
def chat(message,history):
response = pipe(message,max_new_tokens=150)[0]["generated_text"]
return response
demo = gr.ChatInterface(fn=chat,title="Simple CPU chatbot")
demo.launch()