Update app.py
Browse files8 unmodified lines910111213141516171819208 unmodified linesself.client = InferenceClient(model_id, token=token)def load_lora_weights(self):# Define the path to the LoRA modellora_model_path = "./lora_file.pth" # Assuming the file is saved locally# Check if the file existsif not os.path.exists(lora_model_path):raise FileNotFoundError(f"LoRA file not found at path: {lora_model_path}")# Load the LoRA weights from the local filewith open(lora_model_path, "rb") as f:8 unmodified lines91011121314151617181920212223248 unmodified linesself.client = InferenceClient(model_id, token=token)def load_lora_weights(self):# Define the path to the LoRA modellora_model_path = "./lora.model.pth" # Update to the actual file name# Check if the file exists at the given pathif os.path.exists(lora_model_path):print(f"Found LoRA model at: {lora_model_path}")with open(lora_model_path, 'rb') as f:return f.read() # Load the file contentelse:raise FileNotFoundError(f"LoRA model not found at path: {lora_model_path}")# Load the LoRA weights from the local filewith open(lora_model_path, "rb") as f:
app.py+10-6