Texttra commited on
Commit
d8adfd2
·
verified ·
1 Parent(s): eaf5244

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +7 -8
handler.py CHANGED
@@ -15,16 +15,16 @@ class EndpointHandler:
15
  torch_dtype=torch.float16,
16
  )
17
 
18
- # Diagnostic print to inspect available methods
19
  print("🔍 Available methods on pipeline:", dir(self.pipe))
20
 
21
- # Load your local LoRA file
22
  try:
23
- lora_path = "./Bh0r1.safetensors" # relative path within the container
24
-
25
- # Attempt to load LoRA weights (will fail if unsupported)
26
- self.pipe.load_lora_weights(lora_path)
27
- print(f"✅ LoRA weights loaded from {lora_path}.")
28
  except Exception as e:
29
  print(f"⚠️ Failed to load LoRA weights: {str(e)}")
30
 
@@ -38,7 +38,6 @@ class EndpointHandler:
38
 
39
  # Defensive parsing
40
  if isinstance(data, dict):
41
- # Direct prompt/image dict
42
  prompt = data.get("prompt")
43
  image_input = data.get("image")
44
 
 
15
  torch_dtype=torch.float16,
16
  )
17
 
18
+ # Debug available methods on pipeline
19
  print("🔍 Available methods on pipeline:", dir(self.pipe))
20
 
21
+ # Load your LoRA weights from your Hugging Face repo
22
  try:
23
+ self.pipe.load_lora_weights(
24
+ "Texttra/BhoriKontext",
25
+ weight_name="Bh0r1.safetensors"
26
+ )
27
+ print("✅ LoRA weights loaded from Texttra/BhoriKontext/Bh0r1.safetensors.")
28
  except Exception as e:
29
  print(f"⚠️ Failed to load LoRA weights: {str(e)}")
30
 
 
38
 
39
  # Defensive parsing
40
  if isinstance(data, dict):
 
41
  prompt = data.get("prompt")
42
  image_input = data.get("image")
43