Spaces:
Sleeping
Sleeping
Commit
·
89cab91
1
Parent(s):
8332b9e
Update app.py
Browse files
app.py
CHANGED
@@ -18,12 +18,13 @@ def predict():
|
|
18 |
def avp():
|
19 |
incoming = request.get_json()
|
20 |
print(incoming)
|
|
|
21 |
for key, value in incoming.items():
|
22 |
if int(value) > 0:
|
23 |
-
|
24 |
else:
|
25 |
-
|
26 |
-
response = jsonify(
|
27 |
return response
|
28 |
if __name__ == '__main__':
|
29 |
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 7860)))
|
|
|
18 |
def avp():
|
19 |
incoming = request.get_json()
|
20 |
print(incoming)
|
21 |
+
result = {}
|
22 |
for key, value in incoming.items():
|
23 |
if int(value) > 0:
|
24 |
+
result[key] = str(int(value) - 1)
|
25 |
else:
|
26 |
+
result[key] = "0"
|
27 |
+
response = jsonify(result)
|
28 |
return response
|
29 |
if __name__ == '__main__':
|
30 |
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 7860)))
|