Spaces:
Runtime error
Runtime error
Abineshkumar77 commited on
Commit ·
c9fb455
1
Parent(s): cd2e477
Add application file
Browse files- Dockerfile +17 -3
- requirements.txt +2 -7
Dockerfile
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
|
|
|
| 6 |
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Set the working directory in the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy the current directory contents into the container at /app
|
| 8 |
+
COPY . /app
|
| 9 |
|
| 10 |
+
# Install any needed packages specified in requirements.txt
|
| 11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
+
# Make port 80 available to the world outside this container
|
| 14 |
+
EXPOSE 80
|
| 15 |
+
|
| 16 |
+
# Define environment variable
|
| 17 |
+
ENV TRANSFORMERS_CACHE=/app/.cache
|
| 18 |
+
|
| 19 |
+
# Create cache directory
|
| 20 |
+
RUN mkdir -p /app/.cache
|
| 21 |
+
|
| 22 |
+
# Run app.py when the container launches
|
| 23 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "80"]
|
requirements.txt
CHANGED
|
@@ -1,10 +1,5 @@
|
|
| 1 |
-
fastapi[standard]
|
| 2 |
-
uvicorn[standard]
|
| 3 |
-
transformers[standard]
|
| 4 |
-
torch[standard]
|
| 5 |
-
torchvision[standard]
|
| 6 |
-
torchaudio[standard]
|
| 7 |
fastapi
|
| 8 |
uvicorn
|
| 9 |
transformers
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
fastapi
|
| 2 |
uvicorn
|
| 3 |
transformers
|
| 4 |
+
torch
|
| 5 |
+
scipy
|