altryne commited on
Commit
aa5411c
·
1 Parent(s): a72265c

Return the function early without breaking shit

Browse files
Files changed (1) hide show
  1. utils/apis.py +2 -1
utils/apis.py CHANGED
@@ -29,8 +29,9 @@ def call_gradio_api(api_name='test_api', data=()):
29
  print(f"Calling {gradio_url} with {payload}")
30
  resp = requests.request("POST", gradio_url, headers=headers, data=payload)
31
  print(f"Finished calling gradio API with result")
32
- print(resp)
33
  print(resp.text)
 
 
34
  data = resp.json()['data']
35
  if data:
36
  video_path = data[0]
 
29
  print(f"Calling {gradio_url} with {payload}")
30
  resp = requests.request("POST", gradio_url, headers=headers, data=payload)
31
  print(f"Finished calling gradio API with result")
 
32
  print(resp.text)
33
+ if api_name == 'caption':
34
+ return json.loads(resp.text)
35
  data = resp.json()['data']
36
  if data:
37
  video_path = data[0]