Spaces:
Runtime error
Runtime error
Commit
·
3de4a9a
1
Parent(s):
d77200b
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,12 +18,15 @@ def predict():
|
|
| 18 |
def avp():
|
| 19 |
incoming = request.get_json()
|
| 20 |
print(incoming)
|
|
|
|
| 21 |
response = {}
|
| 22 |
-
|
|
|
|
| 23 |
if value == 0:
|
| 24 |
response[key] = 0
|
| 25 |
elif value > 0:
|
| 26 |
response[key] = value - 1
|
|
|
|
| 27 |
return jsonify(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 |
+
|
| 22 |
response = {}
|
| 23 |
+
|
| 24 |
+
for key, value in incoming["bazis"].items():
|
| 25 |
if value == 0:
|
| 26 |
response[key] = 0
|
| 27 |
elif value > 0:
|
| 28 |
response[key] = value - 1
|
| 29 |
+
|
| 30 |
return jsonify(response)
|
| 31 |
if __name__ == '__main__':
|
| 32 |
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 7860)))
|