Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,15 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
3 |
|
4 |
model_name = "brdemorin/Phi3_80_steps_v2"
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
|
9 |
def chat(input_text):
|
|
|
3 |
|
4 |
model_name = "brdemorin/Phi3_80_steps_v2"
|
5 |
|
6 |
+
# Update the following parameters as necessary for your GPTQ model
|
7 |
+
gptq_parameters = {
|
8 |
+
"load_in_8bit": False,
|
9 |
+
"device_map": "auto",
|
10 |
+
"trust_remote_code": True, # This is often needed for custom models
|
11 |
+
}
|
12 |
+
|
13 |
+
# Load the model with GPTQ parameters
|
14 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, **gptq_parameters)
|
15 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
16 |
|
17 |
def chat(input_text):
|