aminskjen commited on
Commit
41e9c49
·
verified ·
1 Parent(s): 8121c6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -131,7 +131,8 @@ Scene idea: {scene_idea}"""
131
  try:
132
  image_url = generate_image_hf(scene_idea, expanded_story)
133
  except Exception as e:
134
- logging.warning(f"Image generation failed: {e}")
 
135
 
136
  creation_id = str(uuid.uuid4())
137
  creation = Creation(
@@ -189,6 +190,7 @@ def generate_image_hf(scene_idea, story):
189
  json={"inputs": prompt},
190
  timeout=60
191
  )
 
192
  if res.status_code == 200:
193
  import base64
194
  return f"data:image/png;base64,{base64.b64encode(res.content).decode()}"
 
131
  try:
132
  image_url = generate_image_hf(scene_idea, expanded_story)
133
  except Exception as e:
134
+ image_url = None
135
+ logging.error(f"image generation completely failed")
136
 
137
  creation_id = str(uuid.uuid4())
138
  creation = Creation(
 
190
  json={"inputs": prompt},
191
  timeout=60
192
  )
193
+ logging.info(f"model: {model}, status:{res.status_code},response: {res.text[:300]}")
194
  if res.status_code == 200:
195
  import base64
196
  return f"data:image/png;base64,{base64.b64encode(res.content).decode()}"