Spaces:
Sleeping
Sleeping
updates
Browse files- Dockerfile +3 -4
- webchat.py +0 -9
Dockerfile
CHANGED
|
@@ -8,8 +8,6 @@ ENV PYTHONUNBUFFERED=1
|
|
| 8 |
# Set the working directory in the container
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
# Copy only the requirements file to leverage Docker cache
|
| 14 |
COPY requirements.txt /app/requirements.txt
|
| 15 |
|
|
@@ -19,8 +17,9 @@ RUN python -m pip install --upgrade pip && \
|
|
| 19 |
python -m spacy download en_core_web_md
|
| 20 |
# Create the cache directory and set permissions
|
| 21 |
RUN mkdir -p /app/.cache && \
|
| 22 |
-
chmod -R 777 /app
|
| 23 |
-
|
|
|
|
| 24 |
# Copy the rest of the application code
|
| 25 |
COPY app.py /app/app.py
|
| 26 |
COPY webchat.py /app/webchat.py
|
|
|
|
| 8 |
# Set the working directory in the container
|
| 9 |
WORKDIR /app
|
| 10 |
|
|
|
|
|
|
|
| 11 |
# Copy only the requirements file to leverage Docker cache
|
| 12 |
COPY requirements.txt /app/requirements.txt
|
| 13 |
|
|
|
|
| 17 |
python -m spacy download en_core_web_md
|
| 18 |
# Create the cache directory and set permissions
|
| 19 |
RUN mkdir -p /app/.cache && \
|
| 20 |
+
chmod -R 777 /app && \
|
| 21 |
+
chmod -R 777 /app/.cache
|
| 22 |
+
ENV TRANSFORMERS_CACHE=/app/.cache
|
| 23 |
# Copy the rest of the application code
|
| 24 |
COPY app.py /app/app.py
|
| 25 |
COPY webchat.py /app/webchat.py
|
webchat.py
CHANGED
|
@@ -79,15 +79,6 @@ def get_model_test(model_type, max_tokens, min_tokens, decoding, temperature):
|
|
| 79 |
|
| 80 |
return model
|
| 81 |
|
| 82 |
-
# Set up cache directory
|
| 83 |
-
current_dir = os.getcwd()
|
| 84 |
-
cache_dir = os.path.join(current_dir, ".cache")
|
| 85 |
-
if not os.path.exists(cache_dir):
|
| 86 |
-
os.makedirs(cache_dir)
|
| 87 |
-
|
| 88 |
-
# Set the TRANSFORMERS_CACHE environment variable
|
| 89 |
-
os.environ['TRANSFORMERS_CACHE'] = cache_dir
|
| 90 |
-
|
| 91 |
# Download the model first
|
| 92 |
model = SentenceTransformer('all-MiniLM-L6-v2')
|
| 93 |
|
|
|
|
| 79 |
|
| 80 |
return model
|
| 81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
# Download the model first
|
| 83 |
model = SentenceTransformer('all-MiniLM-L6-v2')
|
| 84 |
|