DmitrMakeev commited on
Commit
89cab91
·
1 Parent(s): 8332b9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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
- 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)))
 
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)))