BeveledCube commited on
Commit
6e0a07a
·
verified ·
1 Parent(s): c36c2b7

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -18,7 +18,7 @@ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
18
  model = model.to(device)
19
 
20
  # Open a thing for the API
21
- @app.route("/api", methods=["POST"])
22
  def receive_data():
23
  data = request.get_json()
24
 
@@ -39,8 +39,8 @@ def receive_data():
39
  return jsonify(answer_data)
40
 
41
  # Incase a normal browser opens the page
42
- @app.route("/")
43
  def not_api():
44
  return render_template("index.html")
45
 
46
- app.run(debug=False, port=7860)
 
18
  model = model.to(device)
19
 
20
  # Open a thing for the API
21
+ @app.post("/api")
22
  def receive_data():
23
  data = request.get_json()
24
 
 
39
  return jsonify(answer_data)
40
 
41
  # Incase a normal browser opens the page
42
+ @app.get("/")
43
  def not_api():
44
  return render_template("index.html")
45
 
46
+ app.run(debug=False, port=7860, load_dotenv=True)