srikarp commited on
Commit
c3e014a
·
verified ·
1 Parent(s): b8ad18e

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +37 -0
  2. requirements.txt +10 -0
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use official PyTorch image with CUDA 12.1 runtime
2
+ FROM pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Prevent Python from writing pyc files and buffering stdout/stderr
8
+ ENV PYTHONDONTWRITEBYTECODE=1
9
+ ENV PYTHONUNBUFFERED=1
10
+
11
+ # Install system dependencies
12
+ RUN apt-get update && apt-get install -y --no-install-recommends \
13
+ build-essential \
14
+ git \
15
+ && rm -rf /lib/apt/lists/*
16
+
17
+ # Install python dependencies
18
+ COPY requirements.txt .
19
+ RUN pip install --no-cache-dir -r requirements.txt
20
+
21
+ # Copy application source code
22
+ COPY gemma_code_llm/ ./gemma_code_llm/
23
+ COPY static/ ./static/
24
+
25
+ # Expose port
26
+ EXPOSE 7860
27
+
28
+ # Default environment variables
29
+ ENV BASE_MODEL="google/gemma-3-1b-it"
30
+ ENV ADAPTER_PATH="/app/outputs/gemma-code-lora"
31
+ ENV QUANTIZATION="none"
32
+ ENV DTYPE="auto"
33
+ ENV TRUST_REMOTE_CODE="0"
34
+
35
+ # Note: The adapter weights should be mounted at /app/outputs/gemma-code-lora or copied in.
36
+ # Start FastAPI application
37
+ CMD ["uvicorn", "gemma_code_llm.api:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ torch>=2.3.0
2
+ transformers>=4.51.0
3
+ accelerate>=0.34.0
4
+ peft>=0.12.0
5
+ safetensors>=0.4.4
6
+ fastapi>=0.115.0
7
+ uvicorn[standard]>=0.30.0
8
+ pydantic>=2.7.0
9
+ bitsandbytes>=0.43.3
10
+