HelloWorld / app.py
Pouyae's picture
feat: Use Phi-4-mini-instruct
513c353
raw
history blame
387 Bytes
import gradio as gr
from transformers import pipeline
generator = pipeline("text-generation", model="microsoft/microsoft/Phi-4-mini-instruct", device_map="auto")
def chat_with_phi(prompt):
response = generator(prompt, max_new_tokens=200, do_sample=False)[0]["generated_text"]
return response
demo = gr.Interface(fn=chat_with_phi, inputs="text", outputs="text")
demo.launch()