minhdang commited on
Commit
f24926f
1 Parent(s): 12625fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -21,15 +21,14 @@ nf4_config = BitsAndBytesConfig(
21
  bnb_4bit_use_double_quant=True,
22
  bnb_4bit_compute_dtype=torch.bfloat16
23
  )
24
-
25
  model_id = "CohereForAI/c4ai-command-r-v01"
26
  tokenizer = AutoTokenizer.from_pretrained(model_id)
27
- model = AutoModelForCausalLM.from_pretrained("c4ai-command-r-v01-exl2",
28
  # load_in_8bit=True,
29
- #quantization_config=nf4_config,
30
  # attn_implementation="flash_attention_2",
31
  # torch_dtype = torch.bfloat16,
32
- #device_map="auto"
33
  )
34
 
35
  # replace_linears_in_hf(model)
 
21
  bnb_4bit_use_double_quant=True,
22
  bnb_4bit_compute_dtype=torch.bfloat16
23
  )
 
24
  model_id = "CohereForAI/c4ai-command-r-v01"
25
  tokenizer = AutoTokenizer.from_pretrained(model_id)
26
+ model = AutoModelForCausalLM.from_pretrained(model_id,
27
  # load_in_8bit=True,
28
+ quantization_config=nf4_config,
29
  # attn_implementation="flash_attention_2",
30
  # torch_dtype = torch.bfloat16,
31
+ device_map="auto"
32
  )
33
 
34
  # replace_linears_in_hf(model)