Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,20 +18,31 @@ def load_model_org():
|
|
| 18 |
)
|
| 19 |
return model, tokenizer
|
| 20 |
|
|
|
|
| 21 |
def load_model():
|
| 22 |
-
tokenizer =
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
| 26 |
)
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|