Fixed cache write permissions
Browse files- Dockerfile +14 -18
- __pycache__/translation_model.cpython-312.pyc +0 -0
- app.py +2 -1
- requirements.txt +1 -0
Dockerfile
CHANGED
|
@@ -1,25 +1,21 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
|
|
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
build-essential \
|
| 13 |
-
cmake \
|
| 14 |
-
libopenblas-dev \
|
| 15 |
-
liblapack-dev \
|
| 16 |
-
libjpeg-dev \
|
| 17 |
-
zlib1g-dev \
|
| 18 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
CMD ["python", "./app.py"]
|
|
|
|
| 1 |
+
# Use an official lightweight Python image
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Set a working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Define a writable cache directory
|
| 8 |
+
ENV TRANSFORMERS_CACHE=/tmp/.cache
|
| 9 |
|
| 10 |
+
# Copy requirements.txt and install dependencies
|
| 11 |
+
COPY requirements.txt .
|
| 12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
| 14 |
+
# Copy the rest of the application files
|
| 15 |
+
COPY . .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
# Expose the port Flask will run on
|
| 18 |
+
EXPOSE 7860
|
| 19 |
|
| 20 |
+
# Run Flask on the correct host and port
|
| 21 |
+
CMD ["flask", "run", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
__pycache__/translation_model.cpython-312.pyc
DELETED
|
Binary file (942 Bytes)
|
|
|
app.py
CHANGED
|
@@ -17,4 +17,5 @@ def translate_text():
|
|
| 17 |
return render_template('index.html', original_text=input_text, translated_text=translated_text, time_taken=translation_time)
|
| 18 |
|
| 19 |
if __name__ == '__main__':
|
| 20 |
-
app.run(
|
|
|
|
|
|
| 17 |
return render_template('index.html', original_text=input_text, translated_text=translated_text, time_taken=translation_time)
|
| 18 |
|
| 19 |
if __name__ == '__main__':
|
| 20 |
+
app.run(host='0.0.0.0', port=7860)
|
| 21 |
+
|
requirements.txt
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
torch
|
| 2 |
tranformers
|
| 3 |
flask
|
|
|
|
| 4 |
|
| 5 |
|
|
|
|
| 1 |
torch
|
| 2 |
tranformers
|
| 3 |
flask
|
| 4 |
+
sentencepiece
|
| 5 |
|
| 6 |
|