Spaces:
Running
Running
File size: 334 Bytes
8f43f48 7b4129c 3da5f02 7b4129c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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() |