Test2 / app.py
braunale's picture
Update app.py
36b0a4e verified
raw
history blame
306 Bytes
import gradio as gr
from transformers import pipeline
chat = pipeline("text-generation", model="microsoft/phi-2")
def chat_with_model(prompt):
response = chat(prompt, max_length=50)
return response[0]['generated_text']
demo = gr.ChatInterface(fn=chat_with_model, title="Echo Bot")
demo.launch()