gdleds commited on
Commit
7ba4981
·
1 Parent(s): 368b63a
Files changed (3) hide show
  1. Dockerfile +1 -1
  2. README.md +1 -1
  3. appfast.py → app.py +4 -0
Dockerfile CHANGED
@@ -21,4 +21,4 @@ COPY . .
21
  EXPOSE 8000
22
 
23
  # Lancer FastAPI avec Uvicorn
24
- CMD ["uvicorn", "appfast:app", "--host", "0.0.0.0", "--port", "8000"]
 
21
  EXPOSE 8000
22
 
23
  # Lancer FastAPI avec Uvicorn
24
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
README.md CHANGED
@@ -88,7 +88,7 @@ curl -X POST "https://ton-espace.hf.space/predict" \
88
 
89
  Pour tester localement :
90
 
91
- uvicorn appfast:app --reload --host 0.0.0.0 --port 8000
92
 
93
 
94
  Puis tester avec :
 
88
 
89
  Pour tester localement :
90
 
91
+ uvicorn app:app --reload --host 0.0.0.0 --port 8000
92
 
93
 
94
  Puis tester avec :
appfast.py → app.py RENAMED
@@ -4,6 +4,7 @@ import joblib
4
  import boto3
5
  import os
6
  import io
 
7
  import numpy as np
8
  from dotenv import load_dotenv
9
 
@@ -46,3 +47,6 @@ def predict(data: InputData):
46
  @app.get("/")
47
  def home():
48
  return {"message": "Bienvenue sur l'API GetAround Pricing! Utilisez /predict pour faire une prédiction."}
 
 
 
 
4
  import boto3
5
  import os
6
  import io
7
+ import uvicorn
8
  import numpy as np
9
  from dotenv import load_dotenv
10
 
 
47
  @app.get("/")
48
  def home():
49
  return {"message": "Bienvenue sur l'API GetAround Pricing! Utilisez /predict pour faire une prédiction."}
50
+
51
+ if __name__ == "__main__":
52
+ uvicorn.run("app:app", host="0.0.0.0", port=7860)