Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -96,20 +96,20 @@ embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-b
|
|
96 |
|
97 |
# Initialize the models
|
98 |
def initialize_phi_model():
|
99 |
-
# model = AutoModelForCausalLM.from_pretrained(
|
100 |
-
# "microsoft/Phi-3.5-mini-instruct",
|
101 |
-
# device_map="cuda",
|
102 |
-
# torch_dtype="auto",
|
103 |
-
# trust_remote_code=True,
|
104 |
-
# )
|
105 |
model = AutoModelForCausalLM.from_pretrained(
|
106 |
-
"microsoft/Phi-3.5-
|
107 |
device_map="cuda",
|
108 |
torch_dtype="auto",
|
109 |
trust_remote_code=True,
|
110 |
)
|
111 |
-
#
|
112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
|
114 |
return pipeline("text-generation", model=model, tokenizer=tokenizer)
|
115 |
|
|
|
96 |
|
97 |
# Initialize the models
|
98 |
def initialize_phi_model():
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
model = AutoModelForCausalLM.from_pretrained(
|
100 |
+
"microsoft/Phi-3.5-mini-instruct",
|
101 |
device_map="cuda",
|
102 |
torch_dtype="auto",
|
103 |
trust_remote_code=True,
|
104 |
)
|
105 |
+
# model = AutoModelForCausalLM.from_pretrained(
|
106 |
+
# "microsoft/Phi-3.5-MoE-instruct",
|
107 |
+
# device_map="cuda",
|
108 |
+
# torch_dtype="auto",
|
109 |
+
# trust_remote_code=True,
|
110 |
+
# )
|
111 |
+
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3.5-mini-instruct")
|
112 |
+
# tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3.5-MoE-instruct")
|
113 |
|
114 |
return pipeline("text-generation", model=model, tokenizer=tokenizer)
|
115 |
|