FlawedLLM commited on
Commit
9d7277a
1 Parent(s): dcde33a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -7,11 +7,11 @@ from peft import PeftModel, PeftConfig
7
 
8
 
9
  tokenizer = AutoTokenizer.from_pretrained("FlawedLLM/BhashiniLLM")
10
- # quantization_config = BitsAndBytesConfig(
11
- # load_in_4bit=True,
12
- # bnb_4bit_use_double_quant=True,
13
- # bnb_4bit_quant_type="nf4",
14
- # bnb_4bit_compute_dtype=torch.float16)
15
  # model = AutoModelForCausalLM.from_pretrained("FlawedLLM/BhashiniLLM",
16
  # device_map="auto",
17
  # quantization_config=quantization_config,
@@ -35,7 +35,7 @@ tokenizer = AutoTokenizer.from_pretrained("FlawedLLM/BhashiniLLM")
35
 
36
 
37
  config = PeftConfig.from_pretrained("FlawedLLM/BhashiniLLM")
38
- base_model = AutoModelForCausalLM.from_pretrained("unsloth/llama-3-8b-bnb-4bit", device_map='auto')
39
  model = PeftModel.from_pretrained(base_model, "FlawedLLM/BhashiniLLM")
40
 
41
 
 
7
 
8
 
9
  tokenizer = AutoTokenizer.from_pretrained("FlawedLLM/BhashiniLLM")
10
+ quantization_config = BitsAndBytesConfig(
11
+ load_in_4bit=True,
12
+ bnb_4bit_use_double_quant=True,
13
+ bnb_4bit_quant_type="nf4",
14
+ bnb_4bit_compute_dtype=torch.float16)
15
  # model = AutoModelForCausalLM.from_pretrained("FlawedLLM/BhashiniLLM",
16
  # device_map="auto",
17
  # quantization_config=quantization_config,
 
35
 
36
 
37
  config = PeftConfig.from_pretrained("FlawedLLM/BhashiniLLM")
38
+ base_model = AutoModelForCausalLM.from_pretrained("unsloth/llama-3-8b-bnb-4bit", device_map='auto', quantization_config=quantization_config)
39
  model = PeftModel.from_pretrained(base_model, "FlawedLLM/BhashiniLLM")
40
 
41