Priyansh Saxena commited on
Commit
d0b0680
·
1 Parent(s): 56808e1

chore: add Docker support for HuggingFace Spaces

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -0
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ COPY requirements.txt .
6
+ RUN pip install --no-cache-dir -r requirements.txt
7
+
8
+ ARG MOCK_LLM=false
9
+ ENV MOCK_LLM=${MOCK_LLM}
10
+
11
+ RUN if [ "$MOCK_LLM" != "true" ]; then \
12
+ pip install llama-cpp-python --no-cache-dir && \
13
+ mkdir -p /models && \
14
+ python -c "from huggingface_hub import hf_hub_download; hf_hub_download('bartowski/Qwen2.5-0.5B-Instruct-GGUF', 'Qwen2.5-0.5B-Instruct-Q4_K_M.gguf', local_dir='/models')"; \
15
+ fi
16
+
17
+ COPY app/ ./app/
18
+ COPY tests/ ./tests/
19
+
20
+ EXPOSE 7860
21
+
22
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]