Lazar Radojevic commited on
Commit
fd98490
·
1 Parent(s): c1a2001
Files changed (3) hide show
  1. Dockerfile +1 -1
  2. main.py +5 -0
  3. run.py +1 -1
Dockerfile CHANGED
@@ -27,7 +27,7 @@ RUN pip install --no-cache-dir -r requirements.txt
27
  COPY --chown=user . .
28
 
29
  # Expose the port FastAPI will run on
30
- EXPOSE 7860
31
 
32
  # Command to run the FastAPI application
33
  CMD ["python", "run.py"]
 
27
  COPY --chown=user . .
28
 
29
  # Expose the port FastAPI will run on
30
+ EXPOSE 7860 8000
31
 
32
  # Command to run the FastAPI application
33
  CMD ["python", "run.py"]
main.py CHANGED
@@ -31,6 +31,11 @@ class QueryResponse(BaseModel):
31
  similar_prompts: List[SimilarPrompt]
32
 
33
 
 
 
 
 
 
34
  # API endpoint
35
  @app.post("/most_similar", response_model=QueryResponse)
36
  async def get_most_similar(query_request: QueryRequest):
 
31
  similar_prompts: List[SimilarPrompt]
32
 
33
 
34
+ @app.get("/")
35
+ def read_root():
36
+ return {"message": "Hello, FastAPI!"}
37
+
38
+
39
  # API endpoint
40
  @app.post("/most_similar", response_model=QueryResponse)
41
  async def get_most_similar(query_request: QueryRequest):
run.py CHANGED
@@ -3,5 +3,5 @@ import uvicorn
3
  # import subprocess
4
 
5
  if __name__ == "__main__":
6
- uvicorn.run("main:app", host="0.0.0.0", port=7860, reload=True)
7
  # subprocess.run(["streamlit", "run", "app.py", "--server.port", "7860"])
 
3
  # import subprocess
4
 
5
  if __name__ == "__main__":
6
+ uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)
7
  # subprocess.run(["streamlit", "run", "app.py", "--server.port", "7860"])