jordigonzm commited on
Commit
896b82a
1 Parent(s): f455b1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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",