Tim Luka Horstmann commited on
Commit
1faeb4c
·
1 Parent(s): 588cb6a

updated app to use ctransformers and gemma

Browse files
Files changed (2) hide show
  1. Dockerfile +7 -9
  2. requirements.txt +3 -2
Dockerfile CHANGED
@@ -1,35 +1,33 @@
1
  # Use an official Python runtime as a base image
2
- FROM python:3.10-slim
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- # Install system dependencies (e.g., for torch, sentence-transformers)
8
  RUN apt-get update && apt-get install -y \
9
  gcc \
10
  g++ \
11
  libffi-dev \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Set environment variable for transformers cache
15
  ENV TRANSFORMERS_CACHE=/app/cache
16
  ENV HF_HOME=/app/cache
17
 
18
- # Create cache directory and ensure it's writable
19
  RUN mkdir -p /app/cache && chmod -R 777 /app/cache
20
 
21
- # Copy requirements file
22
  COPY requirements.txt .
23
-
24
- # Install Python dependencies
25
  RUN pip install --no-cache-dir -r requirements.txt
26
 
27
  # Copy application files
28
  COPY app.py .
29
  COPY cv_embeddings.json .
30
 
31
- # Expose the port FastAPI will run on
32
  EXPOSE 7860
33
 
34
- # Command to run the application
35
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # Use an official Python runtime as a base image
2
+ FROM python:3.10
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install system dependencies for ctransformers and runtime
8
  RUN apt-get update && apt-get install -y \
9
  gcc \
10
  g++ \
11
  libffi-dev \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Set environment variables for cache and token
15
  ENV TRANSFORMERS_CACHE=/app/cache
16
  ENV HF_HOME=/app/cache
17
 
18
+ # Create cache directory with write permissions
19
  RUN mkdir -p /app/cache && chmod -R 777 /app/cache
20
 
21
+ # Copy and install requirements
22
  COPY requirements.txt .
 
 
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
  # Copy application files
26
  COPY app.py .
27
  COPY cv_embeddings.json .
28
 
29
+ # Expose port
30
  EXPOSE 7860
31
 
32
+ # Run the application
33
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt CHANGED
@@ -1,6 +1,7 @@
1
  fastapi==0.115.0
2
  uvicorn==0.31.0
3
  sentence-transformers==3.1.1
4
- transformers==4.44.2
5
  torch==2.4.1
6
- numpy==1.26.4
 
 
 
1
  fastapi==0.115.0
2
  uvicorn==0.31.0
3
  sentence-transformers==3.1.1
 
4
  torch==2.4.1
5
+ numpy==1.26.4
6
+ ctransformers==0.2.27
7
+ huggingface_hub==0.30.1