Spaces:
Sleeping
Sleeping
Commit
·
f2d04f3
1
Parent(s):
9686017
yes
Browse files- Dockerfile +6 -6
- app.py +19 -1
Dockerfile
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
FROM python:3.9
|
| 2 |
|
| 3 |
-
# Set working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
# Copy and install dependencies
|
| 7 |
COPY requirements.txt .
|
| 8 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 9 |
RUN pip install --no-cache-dir fastapi uvicorn python-multipart
|
| 10 |
|
| 11 |
-
# Copy the rest of the app
|
| 12 |
COPY . .
|
| 13 |
|
| 14 |
-
# Expose port (HF Spaces expects 7860)
|
| 15 |
-
EXPOSE 7860
|
| 16 |
|
| 17 |
-
# Start the FastAPI server
|
| 18 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
FROM python:3.9
|
| 2 |
|
| 3 |
+
# # Set working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# # Copy and install dependencies
|
| 7 |
COPY requirements.txt .
|
| 8 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 9 |
RUN pip install --no-cache-dir fastapi uvicorn python-multipart
|
| 10 |
|
| 11 |
+
# # Copy the rest of the app
|
| 12 |
COPY . .
|
| 13 |
|
| 14 |
+
# # Expose port (HF Spaces expects 7860)
|
| 15 |
+
# EXPOSE 7860
|
| 16 |
|
| 17 |
+
# # Start the FastAPI server
|
| 18 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
CHANGED
|
@@ -124,4 +124,22 @@ async def get_classes():
|
|
| 124 |
return {"classes": class_name}
|
| 125 |
|
| 126 |
if __name__ == "__main__":
|
| 127 |
-
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
return {"classes": class_name}
|
| 125 |
|
| 126 |
if __name__ == "__main__":
|
| 127 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
|