satishpednekar commited on
Commit
6b01cb7
·
verified ·
1 Parent(s): dc4aae7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -10
app.py CHANGED
@@ -18,20 +18,31 @@ def load_model_org():
18
  )
19
  return model, tokenizer
20
 
 
21
  def load_model():
22
- tokenizer = AutoTokenizer.from_pretrained(
23
- MODEL_NAME,
24
- trust_remote_code=True,
25
- model_max_length=128256 # Match your model's vocabulary size
 
 
26
  )
27
 
28
- model = AutoModelForCausalLM.from_pretrained(
29
- MODEL_NAME,
30
- torch_dtype=torch.float16,
31
- device_map="auto",
32
- trust_remote_code=True,
33
- load_in_8bit=False
 
 
 
 
 
 
 
34
  )
 
35
  return model, tokenizer
36
 
37
 
 
18
  )
19
  return model, tokenizer
20
 
21
+
22
  def load_model():
23
+ model, tokenizer = FastLanguageModel.from_pretrained(
24
+ model_name="satishpednekar/sbxcertqueryhelper", # Use the path where you saved the model
25
+ max_seq_length=4096, # Use the same as during training
26
+ dtype=torch.float16,
27
+ load_in_4bit=False,
28
+ token="ff"
29
  )
30
 
31
+ # Configure PEFT settings exactly as during training
32
+ model = FastLanguageModel.get_peft_model(
33
+ model,
34
+ r=16,
35
+ target_modules=["q_proj", "k_proj", "v_proj", "o_proj",
36
+ "gate_proj", "up_proj", "down_proj"],
37
+ lora_alpha=16,
38
+ lora_dropout=0,
39
+ bias="none",
40
+ use_gradient_checkpointing="unsloth",
41
+ random_state=3407,
42
+ use_rslora=False,
43
+ loftq_config=None
44
  )
45
+
46
  return model, tokenizer
47
 
48