camenduru commited on
Commit
8645dc4
1 Parent(s): f41d5c1

Update worker_runpod.py

Browse files
Files changed (1) hide show
  1. worker_runpod.py +2 -1
worker_runpod.py CHANGED
@@ -211,7 +211,8 @@ def generate(input):
211
 
212
  if response and response.status_code == 200:
213
  try:
214
- payload = {"jobId": job_id, "result": response.json()['attachments'][0]['url']}
 
215
  requests.post(f"{web_uri}/api/notify", data=json.dumps(payload), headers={'Content-Type': 'application/json', "authorization": f"{web_token}"})
216
  except Exception as e:
217
  print(f"An unexpected error occurred: {e}")
 
211
 
212
  if response and response.status_code == 200:
213
  try:
214
+ urls = [attachment['url'] for attachment in response.json()['attachments']]
215
+ payload = {"jobId": str(job_id), "result": str(urls)}
216
  requests.post(f"{web_uri}/api/notify", data=json.dumps(payload), headers={'Content-Type': 'application/json', "authorization": f"{web_token}"})
217
  except Exception as e:
218
  print(f"An unexpected error occurred: {e}")