broadfield-dev commited on
Commit
b7ed5ce
·
verified ·
1 Parent(s): dc75a1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -86,7 +86,12 @@ def step():
86
 
87
  agent_position = next_state
88
 
89
- return jsonify({'agent_position': agent_position, 'target': target, 'maze': maze.tolist()})
 
 
 
 
 
90
 
91
  if __name__ == '__main__':
92
  app.run(host='0.0.0.0', port=7860)
 
86
 
87
  agent_position = next_state
88
 
89
+ # Convert NumPy arrays to lists to ensure JSON serializability
90
+ return jsonify({
91
+ 'agent_position': list(agent_position),
92
+ 'target': list(target),
93
+ 'maze': maze.tolist()
94
+ })
95
 
96
  if __name__ == '__main__':
97
  app.run(host='0.0.0.0', port=7860)