ishworrsubedii
commited on
Commit
·
a9406aa
1
Parent(s):
a4a2363
add: setup code and update docker for permission
Browse files- Dockerfile +6 -0
- requirements.txt +1 -0
- setup.py +17 -0
Dockerfile
CHANGED
@@ -4,6 +4,9 @@ WORKDIR /app
|
|
4 |
|
5 |
COPY . /app
|
6 |
|
|
|
|
|
|
|
7 |
RUN chmod -R 777 /app
|
8 |
|
9 |
RUN apt-get update && \
|
@@ -27,6 +30,9 @@ RUN pip install --no-cache-dir nltk && \
|
|
27 |
RUN pip install --no-cache-dir --upgrade pip && \
|
28 |
pip install --no-cache-dir -r requirements.txt
|
29 |
|
|
|
|
|
|
|
30 |
EXPOSE 7860
|
31 |
|
32 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--timeout-keep-alive", "300", "--timeout-graceful-shutdown", "600"]
|
|
|
4 |
|
5 |
COPY . /app
|
6 |
|
7 |
+
RUN mkdir -p /.cache && \
|
8 |
+
chmod -R 777 /.cache
|
9 |
+
|
10 |
RUN chmod -R 777 /app
|
11 |
|
12 |
RUN apt-get update && \
|
|
|
30 |
RUN pip install --no-cache-dir --upgrade pip && \
|
31 |
pip install --no-cache-dir -r requirements.txt
|
32 |
|
33 |
+
ENV TRANSFORMERS_CACHE=/.cache/huggingface
|
34 |
+
ENV HF_HOME=/.cache/huggingface
|
35 |
+
|
36 |
EXPOSE 7860
|
37 |
|
38 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--timeout-keep-alive", "300", "--timeout-graceful-shutdown", "600"]
|
requirements.txt
CHANGED
@@ -97,3 +97,4 @@ pdf2image
|
|
97 |
PyPDF2
|
98 |
PyJWT
|
99 |
replicate
|
|
|
|
97 |
PyPDF2
|
98 |
PyJWT
|
99 |
replicate
|
100 |
+
-e .
|
setup.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from setuptools import setup, find_packages
|
2 |
+
|
3 |
+
HYPER_E_DOT = "-e ."
|
4 |
+
def requirement_install(requirementsPath: str) -> list[str]:
|
5 |
+
with open(requirementsPath) as file:
|
6 |
+
requirements = file.read().split("\n")
|
7 |
+
requirements.remove(HYPER_E_DOT)
|
8 |
+
return requirements
|
9 |
+
|
10 |
+
setup(
|
11 |
+
name = "Convai",
|
12 |
+
author = "Ishwor Subedi",
|
13 |
+
author_email = "[email protected]",
|
14 |
+
version = "0.1",
|
15 |
+
packages = find_packages(),
|
16 |
+
install_requires = requirement_install(requirementsPath ="./requirements.txt")
|
17 |
+
)
|