nmarafo commited on
Commit
328e3f3
·
verified ·
1 Parent(s): 5f66366

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -12,15 +12,12 @@ token = os.environ.get("HF_TOKEN")
12
 
13
  model_id = "google/shieldgemma-2b"
14
 
15
- # Use quantization to lower GPU usage
16
  bnb_config = BitsAndBytesConfig(
17
- load_in_4bit=True,
18
- bnb_4bit_use_double_quant=True,
19
- bnb_4bit_quant_type="nf4",
20
- bnb_4bit_compute_dtype=torch.bfloat16
21
  )
22
 
23
- tokenizer = AutoTokenizer.from_pretrained(model_id, token=token)
24
  model = AutoModelForCausalLM.from_pretrained(
25
  model_id,
26
  torch_dtype=torch.bfloat16,
 
12
 
13
  model_id = "google/shieldgemma-2b"
14
 
15
+ # use quantization to lower GPU usage
16
  bnb_config = BitsAndBytesConfig(
17
+ load_in_4bit=True, bnb_4bit_use_double_quant=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.bfloat16
 
 
 
18
  )
19
 
20
+ tokenizer = AutoTokenizer.from_pretrained(model_id,token=token)
21
  model = AutoModelForCausalLM.from_pretrained(
22
  model_id,
23
  torch_dtype=torch.bfloat16,