Spaces:
Runtime error
Runtime error
Update space
Browse files
app.py
CHANGED
@@ -91,6 +91,7 @@ def trim_adapter_weights(model_path):
|
|
91 |
key_to_trim = "lm_head.lora_B.default.weight"
|
92 |
|
93 |
if key_to_trim in checkpoint:
|
|
|
94 |
original_size = checkpoint[key_to_trim].shape[0]
|
95 |
expected_size = original_size - 1 # Removing last token
|
96 |
|
@@ -102,7 +103,7 @@ def trim_adapter_weights(model_path):
|
|
102 |
trimmed_adapter_path = os.path.join(model_path, "adapter_model_trimmed.safetensors")
|
103 |
save_file(checkpoint, trimmed_adapter_path)
|
104 |
return trimmed_adapter_path
|
105 |
-
|
106 |
return model_path
|
107 |
model_path=os.path.join(MODEL_1_PATH,"adapter_model.safetensors")
|
108 |
trimmed_adapter_path = trim_adapter_weights(model_path)
|
|
|
91 |
key_to_trim = "lm_head.lora_B.default.weight"
|
92 |
|
93 |
if key_to_trim in checkpoint:
|
94 |
+
print("Entered")
|
95 |
original_size = checkpoint[key_to_trim].shape[0]
|
96 |
expected_size = original_size - 1 # Removing last token
|
97 |
|
|
|
103 |
trimmed_adapter_path = os.path.join(model_path, "adapter_model_trimmed.safetensors")
|
104 |
save_file(checkpoint, trimmed_adapter_path)
|
105 |
return trimmed_adapter_path
|
106 |
+
print("Escaped from here hahaha")
|
107 |
return model_path
|
108 |
model_path=os.path.join(MODEL_1_PATH,"adapter_model.safetensors")
|
109 |
trimmed_adapter_path = trim_adapter_weights(model_path)
|