Spaces:
Runtime error
Runtime error
Upload 3 files
Browse files- Dockerfile +13 -0
- app.py +21 -0
- requirements.txt +6 -0
Dockerfile
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.9
|
| 2 |
+
|
| 3 |
+
RUN useradd -m -u 1000 user
|
| 4 |
+
USER user
|
| 5 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 6 |
+
|
| 7 |
+
WORKDIR /app
|
| 8 |
+
|
| 9 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
| 10 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 11 |
+
|
| 12 |
+
COPY --chown=user . /app
|
| 13 |
+
CMD ["python", "app.py"]
|
app.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Copy download link
|
| 3 |
+
history
|
| 4 |
+
blame
|
| 5 |
+
contribute
|
| 6 |
+
delete
|
| 7 |
+
|
| 8 |
+
373 Bytes
|
| 9 |
+
import os
|
| 10 |
+
import uvicorn
|
| 11 |
+
from fastapi import FastAPI
|
| 12 |
+
|
| 13 |
+
app = FastAPI()
|
| 14 |
+
|
| 15 |
+
@app.get("/")
|
| 16 |
+
def read_root():
|
| 17 |
+
return {"message": "Hello from Hugging my love worrl d pcoc lococoooo Face Spaces!"}
|
| 18 |
+
|
| 19 |
+
if __name__ == "__main__":
|
| 20 |
+
port = int(os.environ.get("PORT", 7860)) # Récupérer le port depuis les variables d'environnement
|
| 21 |
+
uvicorn.run(app, host="127.0.0.1", port=port)
|
requirements.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastapi==0.74.*
|
| 2 |
+
requests==2.31.*
|
| 3 |
+
uvicorn
|
| 4 |
+
sentencepiece
|
| 5 |
+
torch
|
| 6 |
+
transformers
|