Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,13 @@ My favorite part of the book though was when the hobbits met Tom Bombadil, it's
|
|
42 |
input_data = json.dumps({'inputs':user_input})
|
43 |
r = requests.post(URL,
|
44 |
data=input_data,
|
45 |
-
headers=headers).json()
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
label, score = convert_dict[r['label']], r['score']
|
48 |
|
|
|
42 |
input_data = json.dumps({'inputs':user_input})
|
43 |
r = requests.post(URL,
|
44 |
data=input_data,
|
45 |
+
headers=headers).json()
|
46 |
+
|
47 |
+
if 0 not in r:
|
48 |
+
st.write(r)
|
49 |
+
return
|
50 |
+
else:
|
51 |
+
r=r[0]
|
52 |
|
53 |
label, score = convert_dict[r['label']], r['score']
|
54 |
|