Spaces:
Sahaltech
/
Running on CPU Upgrade

File size: 869 Bytes
405b2f1
7e3c986
 
 
405b2f1
 
 
 
 
 
 
bb94e39
 
 
 
 
7e3c986
 
 
b7a229d
7e3c986
 
b7a229d
405b2f1
b7a229d
 
 
 
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 pytorch/pytorch:2.6.0-cuda12.4-cudnn9-runtime

WORKDIR /app

ENV PYTHONUNBUFFERED=1 \
	HF_HOME=/tmp/huggingface \
	TRANSFORMERS_CACHE=/tmp/huggingface/transformers \
	HF_DATASETS_CACHE=/tmp/huggingface/datasets \
	NVIDIA_VISIBLE_DEVICES=all \
	NVIDIA_DRIVER_CAPABILITIES=compute,utility

RUN apt-get update && apt-get install -y --no-install-recommends \
    git \
    ffmpeg \
    openjdk-17-jre-headless \
    && rm -rf /var/lib/apt/lists/*

COPY . .

RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]

# docker buildx build --platform linux/amd64 --no-cache -t ai-api .
# docker tag ai-api kora3/ai-api:latest
# docker push kora3/ai-api:latest