Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -5,15 +5,16 @@ import torch
|
|
5 |
# Set the random seed for reproducibility
|
6 |
torch.random.manual_seed(0)
|
7 |
|
8 |
-
# Load the model and tokenizer
|
9 |
-
model_name = "microsoft/Phi-3.5-mini-instruct"
|
10 |
model = AutoModelForCausalLM.from_pretrained(
|
11 |
-
|
12 |
device_map="auto",
|
13 |
torch_dtype="auto",
|
14 |
-
trust_remote_code=True
|
|
|
|
|
15 |
)
|
16 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
17 |
|
18 |
# Set up the pipeline
|
19 |
pipe = pipeline(
|
|
|
5 |
# Set the random seed for reproducibility
|
6 |
torch.random.manual_seed(0)
|
7 |
|
8 |
+
# Load the model and tokenizer with pinned revision
|
|
|
9 |
model = AutoModelForCausalLM.from_pretrained(
|
10 |
+
"microsoft/Phi-3.5-mini-instruct",
|
11 |
device_map="auto",
|
12 |
torch_dtype="auto",
|
13 |
+
trust_remote_code=True,
|
14 |
+
revision="main", # Pin the revision for stability
|
15 |
+
attn_implementation="eager" # Use eager attention implementation if flash-attention is not installed
|
16 |
)
|
17 |
+
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3.5-mini-instruct")
|
18 |
|
19 |
# Set up the pipeline
|
20 |
pipe = pipeline(
|