Spaces:
Paused
Paused
feat(dep_sizes.txt): removes dep_sizes.txt during build, it not needed
Browse files- Dockerfile +0 -6
- openai_compatible_api_server.py +0 -10
Dockerfile
CHANGED
@@ -6,8 +6,6 @@ ENV PATH="/home/user/.local/bin:$PATH"
|
|
6 |
|
7 |
WORKDIR /app
|
8 |
|
9 |
-
# revent python from generating .pyc files you don't need
|
10 |
-
ENV PYTHONDONTWRITEBYTECODE=1
|
11 |
COPY --chown=user ./requirements.txt requirements.txt
|
12 |
RUN pip install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu113
|
13 |
|
@@ -27,10 +25,6 @@ COPY --chown=user . /app
|
|
27 |
#
|
28 |
# RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true HF_TOKEN=$(cat /run/secrets/HF_TOKEN) python /app/download_model.py
|
29 |
|
30 |
-
# Getting the biggest dependencies
|
31 |
-
# https://stackoverflow.com/a/78014074
|
32 |
-
RUN python -c "for d in __import__('importlib.metadata').metadata.distributions(): print('{:>12.3f} KiB {}'.format(sum(0 if not f.locate().is_file() else f.locate().stat().st_size for f in d.files) / 1024, d.name))" | sort > dep_sizes.txt
|
33 |
-
|
34 |
EXPOSE 7860
|
35 |
|
36 |
#CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
6 |
|
7 |
WORKDIR /app
|
8 |
|
|
|
|
|
9 |
COPY --chown=user ./requirements.txt requirements.txt
|
10 |
RUN pip install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu113
|
11 |
|
|
|
25 |
#
|
26 |
# RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true HF_TOKEN=$(cat /run/secrets/HF_TOKEN) python /app/download_model.py
|
27 |
|
|
|
|
|
|
|
|
|
28 |
EXPOSE 7860
|
29 |
|
30 |
#CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
openai_compatible_api_server.py
CHANGED
@@ -287,16 +287,6 @@ def engine_client(request: Request) -> EngineClient:
|
|
287 |
return request.app.state.engine_client
|
288 |
|
289 |
|
290 |
-
@router.get("/")
|
291 |
-
async def home(raw_request: Request) -> Response:
|
292 |
-
dep_sizes: str = ""
|
293 |
-
with open('/app/dep_sizes.txt', mode='r') as f:
|
294 |
-
dep_sizes = f.readline()
|
295 |
-
f.close()
|
296 |
-
|
297 |
-
return Response(status_code=200, content=dep_sizes)
|
298 |
-
|
299 |
-
|
300 |
@router.get("/health")
|
301 |
async def health(raw_request: Request) -> Response:
|
302 |
"""Health check."""
|
|
|
287 |
return request.app.state.engine_client
|
288 |
|
289 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
@router.get("/health")
|
291 |
async def health(raw_request: Request) -> Response:
|
292 |
"""Health check."""
|