Kabila22 commited on
Commit
d15a2f0
·
1 Parent(s): f0e12d6

Added trained model

Browse files
Files changed (2) hide show
  1. Dockerfile +13 -10
  2. requirements.txt +10 -0
Dockerfile CHANGED
@@ -1,19 +1,22 @@
1
- FROM python:3.9
 
2
 
 
3
  WORKDIR /app
 
 
4
  COPY . /app
5
 
6
- ENV HF_HOME=/app/.cache
7
 
8
- RUN mkdir -p /app/.cache/huggingface/hub && \
9
- chmod -R 777 /app/.cache && \
10
- chmod -R 777 /app/.cache/huggingface
11
 
12
- RUN pip install --upgrade pip
13
- RUN pip install --no-cache-dir -r requirements.txt
14
- RUN pip install uvicorn
15
- RUN uvicorn --version
16
 
 
17
  EXPOSE 7860
18
 
19
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ # Use official Python base image
2
+ FROM python:3.11-slim
3
 
4
+ # Set the working directory
5
  WORKDIR /app
6
+
7
+ # Copy all files to the container
8
  COPY . /app
9
 
 
10
 
11
+ # Set HF_HOME to use an accessible cache directory
12
+ ENV HF_HOME=/app/.cache
13
+ RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
14
 
15
+ # Install dependencies
16
+ RUN pip install --no-cache-dir -r Requirements.txt
 
 
17
 
18
+ # Expose port (Hugging Face uses port 7860 by default)
19
  EXPOSE 7860
20
 
21
+ # Run the FastAPI server using uvicorn
22
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt CHANGED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ fastapi
2
+ uvicorn
3
+ sentence-transformers
4
+ torch
5
+ scikit-learn
6
+ numpy
7
+ pandas
8
+ openpyxl
9
+ numpy
10
+ huggingface-hub