Spaces:
Sleeping
Sleeping
fixing searcg_enigne problem
Browse files- Dockerfile +5 -2
- api/web_server.py +1 -1
Dockerfile
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
FROM python:3.9 as core
|
| 2 |
|
| 3 |
# Set the working directory
|
|
@@ -29,9 +30,11 @@ RUN pip install -r ./api/requirements.txt
|
|
| 29 |
# Copy the API files
|
| 30 |
COPY ./api ./api
|
| 31 |
|
| 32 |
-
# Copy the
|
|
|
|
|
|
|
|
|
|
| 33 |
COPY --from=core /app/core/engine.pickle /app/api/engine.pickle
|
| 34 |
-
COPY --from=core /app/core/search_engine /app/api/search_engine
|
| 35 |
|
| 36 |
# Set the PYTHONPATH to include the /app directory
|
| 37 |
ENV PYTHONPATH="/app"
|
|
|
|
| 1 |
+
# First stage: Build and load the dataset
|
| 2 |
FROM python:3.9 as core
|
| 3 |
|
| 4 |
# Set the working directory
|
|
|
|
| 30 |
# Copy the API files
|
| 31 |
COPY ./api ./api
|
| 32 |
|
| 33 |
+
# Copy the core files to the second stage to ensure search_engine is available
|
| 34 |
+
COPY ./core ./core
|
| 35 |
+
|
| 36 |
+
# Copy the serialized engine from the first stage to the API directory
|
| 37 |
COPY --from=core /app/core/engine.pickle /app/api/engine.pickle
|
|
|
|
| 38 |
|
| 39 |
# Set the PYTHONPATH to include the /app directory
|
| 40 |
ENV PYTHONPATH="/app"
|
api/web_server.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import dill
|
| 2 |
from fastapi import FastAPI, HTTPException
|
| 3 |
from pydantic import BaseModel
|
| 4 |
-
from search_engine import PromptSearchEngine
|
| 5 |
|
| 6 |
|
| 7 |
class Query(BaseModel):
|
|
|
|
| 1 |
import dill
|
| 2 |
from fastapi import FastAPI, HTTPException
|
| 3 |
from pydantic import BaseModel
|
| 4 |
+
from core.search_engine import PromptSearchEngine
|
| 5 |
|
| 6 |
|
| 7 |
class Query(BaseModel):
|