DonImages commited on
Commit
2442dca
·
verified ·
1 Parent(s): dd28fa5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
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
- # Define the path to the LoRA model
13
- lora_model_path = "./lora_file.pth" # Assuming the file is saved locally
14
-
15
- # Check if the file exists
16
- if not os.path.exists(lora_model_path):
17
- raise FileNotFoundError(f"LoRA file not found at path: {lora_model_path}")
 
 
 
 
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: