Spaces:
Sleeping
Sleeping
Commit
·
96069d0
1
Parent(s):
6a60e40
Add trust_remote_code=True for Mistral model compatibility
Browse files
app.py
CHANGED
@@ -24,11 +24,15 @@ def load_model():
|
|
24 |
peft_model_path = "yitzashapiro/FDA-guidance-zephyr-7b-beta-PEFT"
|
25 |
|
26 |
try:
|
27 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
|
|
|
|
|
|
28 |
model = AutoModelForCausalLM.from_pretrained(
|
29 |
model_path,
|
30 |
device_map="auto",
|
31 |
-
torch_dtype=torch.float16 # Adjust if necessary
|
|
|
32 |
).eval()
|
33 |
model.load_adapter(peft_model_path)
|
34 |
st.success("Model loaded successfully.")
|
|
|
24 |
peft_model_path = "yitzashapiro/FDA-guidance-zephyr-7b-beta-PEFT"
|
25 |
|
26 |
try:
|
27 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
28 |
+
model_path,
|
29 |
+
trust_remote_code=True # Added parameter
|
30 |
+
)
|
31 |
model = AutoModelForCausalLM.from_pretrained(
|
32 |
model_path,
|
33 |
device_map="auto",
|
34 |
+
torch_dtype=torch.float16, # Adjust if necessary
|
35 |
+
trust_remote_code=True # Added parameter
|
36 |
).eval()
|
37 |
model.load_adapter(peft_model_path)
|
38 |
st.success("Model loaded successfully.")
|