Spaces:
Running
Running
Commit
·
314cccb
1
Parent(s):
7379471
Adding Docker Container
Browse files- .env +1 -1
- Dockerfile +13 -4
- __pycache__/app.cpython-311.pyc +0 -0
- app.py +3 -3
- docker-compose.yml +12 -0
.env
CHANGED
@@ -1 +1 @@
|
|
1 |
-
|
|
|
1 |
+
GROQ_API_KEY=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
|
Dockerfile
CHANGED
@@ -1,18 +1,27 @@
|
|
1 |
-
|
|
|
2 |
|
|
|
|
|
|
|
|
|
3 |
WORKDIR /code
|
4 |
|
|
|
5 |
COPY ./requirements.txt /code/requirements.txt
|
6 |
-
|
7 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
8 |
|
|
|
9 |
RUN useradd -m -u 1000 user
|
10 |
USER user
|
11 |
ENV HOME=/home/user \
|
12 |
-
|
13 |
|
|
|
14 |
WORKDIR $HOME/app
|
15 |
|
|
|
16 |
COPY --chown=user . $HOME/app
|
17 |
|
18 |
-
|
|
|
|
1 |
+
# Use the Qdrant image with the patent database as a base
|
2 |
+
FROM kushagrash13/qdrant_with_patent_database:latest
|
3 |
|
4 |
+
# Install Python
|
5 |
+
RUN apt-get update && apt-get install -y python3-pip
|
6 |
+
|
7 |
+
# Set working directory
|
8 |
WORKDIR /code
|
9 |
|
10 |
+
# Copy requirements and install
|
11 |
COPY ./requirements.txt /code/requirements.txt
|
|
|
12 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
13 |
|
14 |
+
# Add a user and set environment variables
|
15 |
RUN useradd -m -u 1000 user
|
16 |
USER user
|
17 |
ENV HOME=/home/user \
|
18 |
+
PATH=/home/user/.local/bin:$PATH
|
19 |
|
20 |
+
# Set working directory for the app
|
21 |
WORKDIR $HOME/app
|
22 |
|
23 |
+
# Copy app code
|
24 |
COPY --chown=user . $HOME/app
|
25 |
|
26 |
+
# Start Qdrant and the application
|
27 |
+
CMD ["sh", "-c", "qdrant & sleep 5 && uvicorn app:app --host 0.0.0.0 --port 7860"]
|
__pycache__/app.cpython-311.pyc
CHANGED
Binary files a/__pycache__/app.cpython-311.pyc and b/__pycache__/app.cpython-311.pyc differ
|
|
app.py
CHANGED
@@ -29,11 +29,11 @@ config = {
|
|
29 |
'threads': int(os.cpu_count() / 2)
|
30 |
}
|
31 |
|
32 |
-
api_key = os.environ.get("
|
33 |
|
34 |
llm = ChatGroq(
|
35 |
model="mixtral-8x7b-32768",
|
36 |
-
api_key=
|
37 |
)
|
38 |
|
39 |
|
@@ -51,7 +51,7 @@ Helpful answer:
|
|
51 |
|
52 |
embeddings = SentenceTransformerEmbeddings(model_name="BAAI/bge-large-en")
|
53 |
|
54 |
-
url = "
|
55 |
|
56 |
client = QdrantClient(
|
57 |
url=url, prefer_grpc=False
|
|
|
29 |
'threads': int(os.cpu_count() / 2)
|
30 |
}
|
31 |
|
32 |
+
api_key = os.environ.get("GROQ_API_KEY")
|
33 |
|
34 |
llm = ChatGroq(
|
35 |
model="mixtral-8x7b-32768",
|
36 |
+
api_key='gsk_I8f2KAiXaThmX9T9LkTUWGdyb3FY9GRYuuMrw36GmZxsLGU8Coh',
|
37 |
)
|
38 |
|
39 |
|
|
|
51 |
|
52 |
embeddings = SentenceTransformerEmbeddings(model_name="BAAI/bge-large-en")
|
53 |
|
54 |
+
url = "http://localhost:6333"
|
55 |
|
56 |
client = QdrantClient(
|
57 |
url=url, prefer_grpc=False
|
docker-compose.yml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: '3.8'
|
2 |
+
|
3 |
+
services:
|
4 |
+
qdrant:
|
5 |
+
image: <your_dockerhub_username>/qdrant_with_patent_database:latest
|
6 |
+
ports:
|
7 |
+
- "6333:6333"
|
8 |
+
volumes:
|
9 |
+
- qdrant_data:/qdrant/data
|
10 |
+
|
11 |
+
volumes:
|
12 |
+
qdrant_data:
|