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