Juslin commited on
Commit
bfab5ee
1 Parent(s): 11519fa

Upload 3 files

Browse files
Files changed (3) hide show
  1. Dockerfile +44 -0
  2. README.md +10 -0
  3. requirements.txt +7 -0
Dockerfile ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Copy the current directory contents into the container at /app
8
+ COPY . /app
9
+
10
+ # Install necessary system packages
11
+ RUN apt-get update && apt-get install -y \
12
+ tesseract-ocr \
13
+ libtesseract-dev \
14
+ poppler-utils
15
+
16
+ # Install Python dependencies
17
+ RUN pip install \
18
+ fastapi \
19
+ uvicorn \
20
+ PyMuPDF \
21
+ torch torchvision\
22
+ tensorflow\
23
+ tf-keras\
24
+ flax\
25
+ pytesseract \
26
+ Pillow \
27
+ llama-index \
28
+ transformers
29
+
30
+ # Create a non-root user
31
+ RUN useradd -ms /bin/bash myuser
32
+
33
+ # Create cache directory with appropriate permissions under user's home directory
34
+ RUN mkdir -p /home/myuser/.cache/huggingface/hub && \
35
+ chown -R myuser /home/myuser/.cache
36
+
37
+ # Switch to the non-root user
38
+ USER myuser
39
+
40
+ # Expose port 80
41
+ EXPOSE 80
42
+
43
+ # Command to run FastAPI using Uvicorn server
44
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
README.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: ORTHOSageAi
3
+ emoji: ⚡
4
+ colorFrom: blue
5
+ colorTo: pink
6
+ sdk: docker
7
+ pinned: true
8
+ ---
9
+
10
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ fitz
2
+ PyMuPDF
3
+ pytesseract
4
+ Pillow
5
+ llama-index
6
+ transformers
7
+ flask