Spaces:
Running
on
L40S
Running
on
L40S
Update app.py
Browse files
app.py
CHANGED
@@ -71,7 +71,7 @@ def predict(request: gr.Request, *args, progress=gr.Progress(track_tqdm=True)):
|
|
71 |
payload["input"][key] = value
|
72 |
|
73 |
response = requests.post("http://0.0.0.0:5000/predictions", headers=headers, json=payload)
|
74 |
-
|
75 |
|
76 |
if response.status_code == 201:
|
77 |
follow_up_url = response.json()["urls"]["get"]
|
@@ -82,6 +82,7 @@ def predict(request: gr.Request, *args, progress=gr.Progress(track_tqdm=True)):
|
|
82 |
response = requests.get(follow_up_url, headers=headers)
|
83 |
time.sleep(1)
|
84 |
if response.status_code == 200:
|
|
|
85 |
json_response = response.json()
|
86 |
#If the output component is JSON return the entire output response
|
87 |
if(outputs[0].get_config()["name"] == "json"):
|
|
|
71 |
payload["input"][key] = value
|
72 |
|
73 |
response = requests.post("http://0.0.0.0:5000/predictions", headers=headers, json=payload)
|
74 |
+
time.sleep(1)
|
75 |
|
76 |
if response.status_code == 201:
|
77 |
follow_up_url = response.json()["urls"]["get"]
|
|
|
82 |
response = requests.get(follow_up_url, headers=headers)
|
83 |
time.sleep(1)
|
84 |
if response.status_code == 200:
|
85 |
+
|
86 |
json_response = response.json()
|
87 |
#If the output component is JSON return the entire output response
|
88 |
if(outputs[0].get_config()["name"] == "json"):
|