Ayeshanoor101
commited on
Commit
•
6c5ce87
1
Parent(s):
d3befba
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,16 @@ import gradio as gr
|
|
4 |
import torch
|
5 |
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
pipe = pipeline(
|
8 |
"text-generation",
|
9 |
model=model,
|
|
|
4 |
import torch
|
5 |
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
6 |
|
7 |
+
torch.random.manual_seed(0)
|
8 |
+
|
9 |
+
model = AutoModelForCausalLM.from_pretrained(
|
10 |
+
"microsoft/Phi-3-mini-128k-instruct",
|
11 |
+
device_map="cuda",
|
12 |
+
torch_dtype="auto",
|
13 |
+
trust_remote_code=True,
|
14 |
+
)
|
15 |
+
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-128k-instruct")
|
16 |
+
|
17 |
pipe = pipeline(
|
18 |
"text-generation",
|
19 |
model=model,
|