LalitMahale
commited on
Commit
·
abafda1
1
Parent(s):
4f11fbf
change
Browse files- Dockerfile +11 -2
- main.py +0 -1
Dockerfile
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
COPY ./ /app
|
| 6 |
|
| 7 |
-
|
|
|
|
| 8 |
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
|
|
|
|
| 11 |
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a slim version of Python 3.10 as the base image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Set the working directory inside the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy the contents of the current directory into the container's working directory
|
| 8 |
COPY ./ /app
|
| 9 |
|
| 10 |
+
# Install all dependencies from requirements.txt
|
| 11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
+
# Set environment variable for Hugging Face cache (optional but recommended)
|
| 14 |
+
ENV TRANSFORMERS_CACHE=/tmp/huggingface_cache
|
| 15 |
|
| 16 |
+
# Expose the port the app will run on (7860 in this case)
|
| 17 |
+
EXPOSE 7860
|
| 18 |
|
| 19 |
+
# Command to run the FastAPI app with uvicorn (make sure your app is in main.py)
|
| 20 |
+
CMD ["uvicorn", "main:app", "--reload", "--host=0.0.0.0", "--port=7860"]
|
main.py
CHANGED
|
@@ -7,7 +7,6 @@ import os
|
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
-
user_query = "hi"
|
| 11 |
def dump_user_question(query):
|
| 12 |
try:
|
| 13 |
if os.path.exists:
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
|
|
|
|
| 10 |
def dump_user_question(query):
|
| 11 |
try:
|
| 12 |
if os.path.exists:
|