licorne2lc commited on
Commit
3cc2196
·
1 Parent(s): af9b0b5
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -3,6 +3,7 @@ import pandas as pd
3
  from pydantic import BaseModel
4
  from fastapi import FastAPI
5
  from joblib import load
 
6
 
7
  description = """
8
  Welcome to the GetAround API, designed to assist you in predicting the rental price for your car!
@@ -71,7 +72,10 @@ async def predict(features: PredictionFeatures):
71
  return {"prediction": prediction.tolist()[0]}
72
 
73
  if __name__ == "__main__":
74
- uvicorn.run(app, host="0.0.0.0", port=4000)
 
 
 
75
 
76
 
77
 
 
3
  from pydantic import BaseModel
4
  from fastapi import FastAPI
5
  from joblib import load
6
+ import os
7
 
8
  description = """
9
  Welcome to the GetAround API, designed to assist you in predicting the rental price for your car!
 
72
  return {"prediction": prediction.tolist()[0]}
73
 
74
  if __name__ == "__main__":
75
+
76
+ port = int(os.getenv("PORT", 7860))
77
+ uvicorn.run(app, host="0.0.0.0", port=port)
78
+
79
 
80
 
81