Update app.py
Browse files
app.py
CHANGED
@@ -9,12 +9,16 @@ class LoRAInferenceWrapper:
|
|
9 |
self.client = InferenceClient(model_id, token=token)
|
10 |
|
11 |
def load_lora_weights(self):
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
18 |
|
19 |
# Load the LoRA weights from the local file
|
20 |
with open(lora_model_path, "rb") as f:
|
|
|
9 |
self.client = InferenceClient(model_id, token=token)
|
10 |
|
11 |
def load_lora_weights(self):
|
12 |
+
# Define the path to the LoRA model
|
13 |
+
lora_model_path = "./lora.model.pth" # Update to the actual file name
|
14 |
+
|
15 |
+
# Check if the file exists at the given path
|
16 |
+
if os.path.exists(lora_model_path):
|
17 |
+
print(f"Found LoRA model at: {lora_model_path}")
|
18 |
+
with open(lora_model_path, 'rb') as f:
|
19 |
+
return f.read() # Load the file content
|
20 |
+
else:
|
21 |
+
raise FileNotFoundError(f"LoRA model not found at path: {lora_model_path}")
|
22 |
|
23 |
# Load the LoRA weights from the local file
|
24 |
with open(lora_model_path, "rb") as f:
|