schroneko commited on
Commit
42e6f8d
1 Parent(s): 878b1d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -15,13 +15,14 @@ dtype = torch.bfloat16
15
  quantization_config = BitsAndBytesConfig(load_in_8bit=True)
16
 
17
  def load_model():
18
- tokenizer = AutoTokenizer.from_pretrained(model_id, use_auth_token=huggingface_token)
19
  model = AutoModelForCausalLM.from_pretrained(
20
  model_id,
21
  torch_dtype=dtype,
22
- device_map=device,
23
  quantization_config=quantization_config,
24
- use_auth_token=huggingface_token
 
25
  )
26
  return tokenizer, model
27
 
 
15
  quantization_config = BitsAndBytesConfig(load_in_8bit=True)
16
 
17
  def load_model():
18
+ tokenizer = AutoTokenizer.from_pretrained(model_id, token=huggingface_token)
19
  model = AutoModelForCausalLM.from_pretrained(
20
  model_id,
21
  torch_dtype=dtype,
22
+ device_map="auto",
23
  quantization_config=quantization_config,
24
+ token=huggingface_token,
25
+ low_cpu_mem_usage=True
26
  )
27
  return tokenizer, model
28