multimodalart HF Staff commited on
Commit
c713922
·
verified ·
1 Parent(s): f73b7a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -189,15 +189,14 @@ def get_huggingface_safetensors(link):
189
  raise Exception("Not a FLUX LoRA!")
190
 
191
  # Extract image and trigger word
192
- try:
193
- image_path = model_card.data.get("widget", [{}])[0].get("output", {}).get("url", None)
194
- print(f"Image path {image_path}")
195
- trigger_word = model_card.data.get("instance_prompt", "")
196
- print(f"Image path {trigger_word}")
197
- image_url = f"https://huggingface.co/{link}/resolve/main/{image_path}" if image_path else None
198
- print(f"Image URL {image_url}")
199
- except Exception as e:
200
- raise gr.Error(e)
201
 
202
  # Initialize Hugging Face file system
203
  fs = HfFileSystem()
 
189
  raise Exception("Not a FLUX LoRA!")
190
 
191
  # Extract image and trigger word
192
+ print("Before trying to get image")
193
+ image_path = model_card.data.get("widget", [{}])[0].get("output", {}).get("url", None)
194
+ print(f"Image path {image_path}")
195
+ trigger_word = model_card.data.get("instance_prompt", "")
196
+ print(f"Image path {trigger_word}")
197
+ image_url = f"https://huggingface.co/{link}/resolve/main/{image_path}" if image_path else None
198
+ print(f"Image URL {image_url}")
199
+
 
200
 
201
  # Initialize Hugging Face file system
202
  fs = HfFileSystem()