Rename appCODE.py to app.py
Browse files- appCODE.py → app.py +8 -2
appCODE.py → app.py
RENAMED
|
@@ -28,10 +28,16 @@ if os.path.exists(lora_path):
|
|
| 28 |
lora_state_dict = torch.load(lora_path, map_location=device)
|
| 29 |
|
| 30 |
try:
|
|
|
|
|
|
|
| 31 |
pipeline.load_lora_weights(lora_state_dict) # Load LoRA weights into the pipeline
|
| 32 |
print("✅ LoRA weights loaded successfully!")
|
| 33 |
-
except
|
| 34 |
-
print(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
else:
|
| 36 |
print("⚠️ LoRA file not found! Running base model.")
|
| 37 |
|
|
|
|
| 28 |
lora_state_dict = torch.load(lora_path, map_location=device)
|
| 29 |
|
| 30 |
try:
|
| 31 |
+
# Assuming `pipeline` has a method `load_lora_weights` to load LoRA weights directly
|
| 32 |
+
# If the pipeline does not support this method, we might need to apply the LoRA weights manually
|
| 33 |
pipeline.load_lora_weights(lora_state_dict) # Load LoRA weights into the pipeline
|
| 34 |
print("✅ LoRA weights loaded successfully!")
|
| 35 |
+
except AttributeError:
|
| 36 |
+
print("❌ pipeline does not support load_lora_weights method. Attempting manual application.")
|
| 37 |
+
# Manual application of weights if load_lora_weights method does not exist
|
| 38 |
+
# This is just a placeholder; you'll need to update this part based on how your LoRA weights should be applied
|
| 39 |
+
# Example:
|
| 40 |
+
# pipeline.model.load_state_dict(lora_state_dict, strict=False)
|
| 41 |
else:
|
| 42 |
print("⚠️ LoRA file not found! Running base model.")
|
| 43 |
|