Spaces:
Sleeping
Sleeping
Commit ·
57c9a43
1
Parent(s): 66628f7
huggingface enabled changes
Browse files- Dockerfile +7 -0
- __pycache__/app_fastapi.cpython-313.pyc +0 -0
- app_fastapi.py +1 -1
Dockerfile
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
COPY requirements.txt .
|
| 6 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 7 |
|
|
|
|
| 8 |
COPY . .
|
| 9 |
|
|
|
|
| 10 |
EXPOSE 7860
|
| 11 |
|
|
|
|
|
|
|
| 12 |
CMD ["uvicorn", "app_fastapi:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Use a Python base image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Set the working directory inside the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy your requirements file and install dependencies
|
| 8 |
COPY requirements.txt .
|
| 9 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
+
# Copy all your local files into the container
|
| 12 |
COPY . .
|
| 13 |
|
| 14 |
+
# Expose port 7860 (Hugging Face requirement)
|
| 15 |
EXPOSE 7860
|
| 16 |
|
| 17 |
+
# Command to run your FastAPI application using the correct port
|
| 18 |
+
# Make sure "app_fastapi:app" matches your Python file name and FastAPI instance name
|
| 19 |
CMD ["uvicorn", "app_fastapi:app", "--host", "0.0.0.0", "--port", "7860"]
|
__pycache__/app_fastapi.cpython-313.pyc
CHANGED
|
Binary files a/__pycache__/app_fastapi.cpython-313.pyc and b/__pycache__/app_fastapi.cpython-313.pyc differ
|
|
|
app_fastapi.py
CHANGED
|
@@ -228,5 +228,5 @@ async def predict(
|
|
| 228 |
# -------------------------------------------------------
|
| 229 |
# Run
|
| 230 |
# -------------------------------------------------------
|
| 231 |
-
if __name__ == "__main__":
|
| 232 |
uvicorn.run("app_fastapi:app", host="0.0.0.0", port=8000, reload=True)
|
|
|
|
| 228 |
# -------------------------------------------------------
|
| 229 |
# Run
|
| 230 |
# -------------------------------------------------------
|
| 231 |
+
#if __name__ == "__main__":
|
| 232 |
uvicorn.run("app_fastapi:app", host="0.0.0.0", port=8000, reload=True)
|