Spaces:
Sleeping
Sleeping
Commit
·
9a93a6a
1
Parent(s):
f85325a
update: server.py
Browse files
server.py
CHANGED
@@ -1,10 +1,13 @@
|
|
1 |
from flask import Flask, request, jsonify
|
2 |
from dotenv import load_dotenv
|
|
|
3 |
from models.fitness_model import FitnessModel
|
4 |
from models.nutrition_model import NutritionModel
|
5 |
|
6 |
load_dotenv()
|
7 |
|
|
|
|
|
8 |
|
9 |
fitness_model = FitnessModel.load()
|
10 |
nutrition_model = NutritionModel()
|
@@ -54,4 +57,4 @@ def nutrition_predict():
|
|
54 |
|
55 |
|
56 |
if __name__ == "__main__":
|
57 |
-
app.run()
|
|
|
1 |
from flask import Flask, request, jsonify
|
2 |
from dotenv import load_dotenv
|
3 |
+
import os
|
4 |
from models.fitness_model import FitnessModel
|
5 |
from models.nutrition_model import NutritionModel
|
6 |
|
7 |
load_dotenv()
|
8 |
|
9 |
+
HOST = os.getenv("FLASK_RUN_HOST", "127.0.0.1")
|
10 |
+
FLASK_RUN_PORT = os.getenv("FLASK_RUN_PORT", 7860)
|
11 |
|
12 |
fitness_model = FitnessModel.load()
|
13 |
nutrition_model = NutritionModel()
|
|
|
57 |
|
58 |
|
59 |
if __name__ == "__main__":
|
60 |
+
app.run(host=HOST, port=FLASK_RUN_PORT)
|