Upload 3 files
Browse files- Dockerfile +21 -0
- app.py +3 -2
- requirements.txt +116 -9
Dockerfile
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official lightweight Python image
|
2 |
+
FROM python:3.12-slim
|
3 |
+
|
4 |
+
# Set working directory inside the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Set the Hugging Face cache directory to /tmp, which is writable
|
8 |
+
ENV HF_HOME="/tmp"
|
9 |
+
|
10 |
+
# Copy requirements and install dependencies
|
11 |
+
COPY requirements.txt .
|
12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
13 |
+
|
14 |
+
# Copy the rest of the app
|
15 |
+
COPY . .
|
16 |
+
|
17 |
+
# Expose Gradio's default port
|
18 |
+
EXPOSE 7860
|
19 |
+
|
20 |
+
# Run the app
|
21 |
+
CMD ["python", "-u", "app.py"]
|
app.py
CHANGED
@@ -123,8 +123,9 @@ def load_pdf(files):
|
|
123 |
# Embed the chunks
|
124 |
# embedding_model_name = "sentence-transformers/all-MiniLM-L6-v2"
|
125 |
embedding_model_name = "bert-base-uncased"
|
126 |
-
embeddings = HuggingFaceEmbeddings(model_name=embedding_model_name, encode_kwargs={"normalize_embeddings": True})
|
127 |
-
|
|
|
128 |
# Store the embeddings in the vector store
|
129 |
vector_store = FAISS.from_documents(texts, embeddings)
|
130 |
|
|
|
123 |
# Embed the chunks
|
124 |
# embedding_model_name = "sentence-transformers/all-MiniLM-L6-v2"
|
125 |
embedding_model_name = "bert-base-uncased"
|
126 |
+
# embeddings = HuggingFaceEmbeddings(model_name=embedding_model_name, encode_kwargs={"normalize_embeddings": True})
|
127 |
+
embeddings = HuggingFaceEmbeddings()
|
128 |
+
|
129 |
# Store the embeddings in the vector store
|
130 |
vector_store = FAISS.from_documents(texts, embeddings)
|
131 |
|
requirements.txt
CHANGED
@@ -1,9 +1,116 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
aiofiles==24.1.0
|
2 |
+
aiohappyeyeballs==2.6.1
|
3 |
+
aiohttp==3.12.4
|
4 |
+
aiosignal==1.3.2
|
5 |
+
annotated-types==0.7.0
|
6 |
+
anyio==4.9.0
|
7 |
+
attrs==25.3.0
|
8 |
+
certifi==2025.4.26
|
9 |
+
charset-normalizer==3.4.2
|
10 |
+
click==8.2.1
|
11 |
+
dataclasses-json==0.6.7
|
12 |
+
distro==1.9.0
|
13 |
+
faiss-cpu==1.11.0
|
14 |
+
fastapi==0.115.12
|
15 |
+
ffmpy==0.5.0
|
16 |
+
filelock==3.18.0
|
17 |
+
frozenlist==1.6.0
|
18 |
+
fsspec==2025.5.1
|
19 |
+
gradio==5.31.0
|
20 |
+
gradio_client==1.10.1
|
21 |
+
greenlet==3.2.2
|
22 |
+
groovy==0.1.2
|
23 |
+
groq==0.25.0
|
24 |
+
h11==0.16.0
|
25 |
+
hf-xet==1.1.2
|
26 |
+
httpcore==1.0.9
|
27 |
+
httpx==0.28.1
|
28 |
+
httpx-sse==0.4.0
|
29 |
+
huggingface-hub==0.32.2
|
30 |
+
idna==3.10
|
31 |
+
Jinja2==3.1.6
|
32 |
+
joblib==1.5.1
|
33 |
+
jsonpatch==1.33
|
34 |
+
jsonpointer==3.0.0
|
35 |
+
langchain==0.3.25
|
36 |
+
langchain-community==0.3.24
|
37 |
+
langchain-core==0.3.62
|
38 |
+
langchain-groq==0.3.2
|
39 |
+
langchain-huggingface==0.2.0
|
40 |
+
langchain-text-splitters==0.3.8
|
41 |
+
langsmith==0.3.43
|
42 |
+
markdown-it-py==3.0.0
|
43 |
+
MarkupSafe==3.0.2
|
44 |
+
marshmallow==3.26.1
|
45 |
+
mdurl==0.1.2
|
46 |
+
mpmath==1.3.0
|
47 |
+
multidict==6.4.4
|
48 |
+
mypy_extensions==1.1.0
|
49 |
+
networkx==3.5
|
50 |
+
numpy==2.2.6
|
51 |
+
nvidia-cublas-cu12==12.6.4.1
|
52 |
+
nvidia-cuda-cupti-cu12==12.6.80
|
53 |
+
nvidia-cuda-nvrtc-cu12==12.6.77
|
54 |
+
nvidia-cuda-runtime-cu12==12.6.77
|
55 |
+
nvidia-cudnn-cu12==9.5.1.17
|
56 |
+
nvidia-cufft-cu12==11.3.0.4
|
57 |
+
nvidia-cufile-cu12==1.11.1.6
|
58 |
+
nvidia-curand-cu12==10.3.7.77
|
59 |
+
nvidia-cusolver-cu12==11.7.1.2
|
60 |
+
nvidia-cusparse-cu12==12.5.4.2
|
61 |
+
nvidia-cusparselt-cu12==0.6.3
|
62 |
+
nvidia-nccl-cu12==2.26.2
|
63 |
+
nvidia-nvjitlink-cu12==12.6.85
|
64 |
+
nvidia-nvtx-cu12==12.6.77
|
65 |
+
orjson==3.10.18
|
66 |
+
packaging==24.2
|
67 |
+
pandas==2.2.3
|
68 |
+
pillow==11.2.1
|
69 |
+
propcache==0.3.1
|
70 |
+
pydantic==2.11.5
|
71 |
+
pydantic-settings==2.9.1
|
72 |
+
pydantic_core==2.33.2
|
73 |
+
pydub==0.25.1
|
74 |
+
Pygments==2.19.1
|
75 |
+
pypdf==5.5.0
|
76 |
+
python-dateutil==2.9.0.post0
|
77 |
+
python-dotenv==1.1.0
|
78 |
+
python-multipart==0.0.20
|
79 |
+
pytz==2025.2
|
80 |
+
PyYAML==6.0.2
|
81 |
+
regex==2024.11.6
|
82 |
+
requests==2.32.3
|
83 |
+
requests-toolbelt==1.0.0
|
84 |
+
rich==14.0.0
|
85 |
+
ruff==0.11.12
|
86 |
+
safehttpx==0.1.6
|
87 |
+
safetensors==0.5.3
|
88 |
+
scikit-learn==1.6.1
|
89 |
+
scipy==1.15.3
|
90 |
+
semantic-version==2.10.0
|
91 |
+
sentence-transformers==4.1.0
|
92 |
+
setuptools==80.9.0
|
93 |
+
shellingham==1.5.4
|
94 |
+
six==1.17.0
|
95 |
+
sniffio==1.3.1
|
96 |
+
SQLAlchemy==2.0.41
|
97 |
+
starlette==0.46.2
|
98 |
+
sympy==1.14.0
|
99 |
+
tenacity==9.1.2
|
100 |
+
threadpoolctl==3.6.0
|
101 |
+
tokenizers==0.21.1
|
102 |
+
tomlkit==0.13.2
|
103 |
+
torch==2.7.0
|
104 |
+
tqdm==4.67.1
|
105 |
+
transformers==4.52.3
|
106 |
+
triton==3.3.0
|
107 |
+
typer==0.16.0
|
108 |
+
typing-inspect==0.9.0
|
109 |
+
typing-inspection==0.4.1
|
110 |
+
typing_extensions==4.13.2
|
111 |
+
tzdata==2025.2
|
112 |
+
urllib3==2.4.0
|
113 |
+
uvicorn==0.34.2
|
114 |
+
websockets==15.0.1
|
115 |
+
yarl==1.20.0
|
116 |
+
zstandard==0.23.0
|