File size: 470 Bytes
4571fa6
f6cc7ad
def81e4
f6cc7ad
 
 
4571fa6
 
 
 
1
2
3
4
5
6
7
8
9
10
import gradio as gr
from transformers import pipeline, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-128k-instruct")

pipe = pipeline("text-generation", model="microsoft/Phi-3-mini-128k-instruct", trust_remote_code=True, tokenizer=tokenizer)
gr.Interface.from_pipeline(pipe,
                           title="TextGen",
                           description="Using pipeline with Phi3",
                           ).launch(inbrowser=True)