fullstuckdev commited on
Commit
2e7d4a0
1 Parent(s): 8c2f469

up dockerfile

Browse files
Files changed (3) hide show
  1. .dockerignore +21 -0
  2. Dockerfile +33 -0
  3. requirements.txt +9 -0
.dockerignore ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ __pycache__
2
+ *.pyc
3
+ *.pyo
4
+ *.pyd
5
+ .Python
6
+ env/
7
+ venv/
8
+ .env
9
+ .venv
10
+ pip-log.txt
11
+ pip-delete-this-directory.txt
12
+ .tox/
13
+ .coverage
14
+ .coverage.*
15
+ .cache
16
+ nosetests.xml
17
+ coverage.xml
18
+ *.cover
19
+ *.log
20
+ .pytest_cache/
21
+ .python-version
Dockerfile ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use NVIDIA CUDA base image
2
+ FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ python3 \
10
+ python3-pip \
11
+ git \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Copy requirements first to leverage Docker cache
15
+ COPY requirements.txt .
16
+
17
+ # Install Python dependencies
18
+ RUN pip3 install --no-cache-dir -r requirements.txt
19
+
20
+ # Copy the rest of the application
21
+ COPY . .
22
+
23
+ # Create model directory
24
+ RUN mkdir -p /app/model/medical_llama_3b
25
+
26
+ # Expose port
27
+ EXPOSE 7860
28
+
29
+ # Set environment variables
30
+ ENV MODEL_PATH=/app/model/medical_llama_3b
31
+
32
+ # Command to run the application
33
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ fastapi==0.104.1
2
+ uvicorn==0.24.0
3
+ torch==2.1.0
4
+ transformers==4.34.1
5
+ datasets==2.14.5
6
+ pydantic==2.4.2
7
+ python-multipart==0.0.6
8
+ huggingface-hub==0.17.3
9
+ accelerate==0.24.1