File size: 721 Bytes
502ce94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1

RUN apt-get update && apt-get install -y \
    g++ python3 python3-pip \
    && rm -rf /var/lib/apt/lists/*

# Fix 1: Added huggingface-hub here
RUN pip3 install --no-cache-dir \
    fastapi uvicorn tiktoken psutil httpx pydantic huggingface-hub

WORKDIR /app

COPY inference.cpp .
COPY main.py .
COPY index.html .
# Fix 2: Removed 'COPY model.bin .' from here

RUN g++ -O3 -march=x86-64 -mavx2 -mfma -fopenmp -ffast-math -std=c++17 \
    -o inference inference.cpp && chmod +x inference

RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
USER appuser

EXPOSE 7860

CMD uvicorn main:app --host 0.0.0.0 --port 7860 --no-access-log