Spaces:
Runtime error
Runtime error
jordigonzm
commited on
Commit
•
896b82a
1
Parent(s):
f455b1e
Update app.py
Browse files
app.py
CHANGED
@@ -12,14 +12,14 @@ def get_device():
|
|
12 |
model_name = "microsoft/Phi-3-mini-128k-instruct"
|
13 |
|
14 |
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
15 |
-
model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True)
|
16 |
|
17 |
# Obtener el dispositivo adecuado según la disponibilidad de GPU
|
18 |
device = get_device()
|
19 |
model.to(device)
|
20 |
-
model = torch.quantization.quantize_dynamic(
|
21 |
-
model, {torch.nn.Linear}, dtype=torch.qint8
|
22 |
-
)
|
23 |
|
24 |
pipeline = transformers.pipeline(
|
25 |
"text-generation",
|
|
|
12 |
model_name = "microsoft/Phi-3-mini-128k-instruct"
|
13 |
|
14 |
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
15 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, trust_remote_code=True)
|
16 |
|
17 |
# Obtener el dispositivo adecuado según la disponibilidad de GPU
|
18 |
device = get_device()
|
19 |
model.to(device)
|
20 |
+
#model = torch.quantization.quantize_dynamic(
|
21 |
+
# model, {torch.nn.Linear}, dtype=torch.qint8
|
22 |
+
#)
|
23 |
|
24 |
pipeline = transformers.pipeline(
|
25 |
"text-generation",
|