almncarlo commited on
Commit
f6cc7ad
1 Parent(s): 4571fa6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,7 +1,9 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
 
4
- pipe = pipeline("text-generation", model="microsoft/Phi-3-mini-128k-instruct", trust_remote_code=True)
 
 
5
  gr.Interface.from_pipeline(pipe,
6
  title="TextGen",
7
  description="Using pipeline with Phi3",
 
1
  import gradio as gr
2
+ from transformers import pipeline, AutoTokenizer
3
 
4
+ tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-128k-instruct")
5
+
6
+ pipe = pipeline("text-generation", model="microsoft/Phi-3-mini-128k-instruct", trust_remote_code=True, tokenizer=tokenizer)
7
  gr.Interface.from_pipeline(pipe,
8
  title="TextGen",
9
  description="Using pipeline with Phi3",