MISSAOUI commited on
Commit
0e79b56
·
verified ·
1 Parent(s): 6006445

Update backend/main.py

Browse files
Files changed (1) hide show
  1. backend/main.py +5 -2
backend/main.py CHANGED
@@ -1,4 +1,5 @@
1
  from operator import index
 
2
  import pandas as pd
3
  import numpy as np
4
  import matplotlib.pyplot as plt
@@ -74,7 +75,9 @@ def predict(data : TransactionModel):
74
  return {"predictions": predictions.tolist()}
75
 
76
 
77
- if __name__ == "__main__":
78
- uvicorn.run("main:app", host="0.0.0.0", port=8000)
 
 
79
 
80
 
 
1
  from operator import index
2
+ import os
3
  import pandas as pd
4
  import numpy as np
5
  import matplotlib.pyplot as plt
 
75
  return {"predictions": predictions.tolist()}
76
 
77
 
78
+
79
+ host = os.getenv("HOST", "0.0.0.0")
80
+ port = os.getenv("PORT", 8000)
81
+ uvicorn.run("main:app", host=host, port=port)
82
 
83