Spaces:
Sleeping
Sleeping
Claude commited on
feat: ajout du support HuggingFace Spaces (port 7860, front matter, app.py)
Browse files- app.py : point d'entrΓ©e HF Spaces, lance picarones.web.app via uvicorn
sur 0.0.0.0:7860
- README.md : bloc front matter YAML en tΓͺte (title, emoji, sdk: dockerβ¦)
- Dockerfile : EXPOSE 7860, health check et CMD migrΓ©s sur le port 7860 ;
suppression du label maintainer rΓ©siduel
https://claude.ai/code/session_017gXea9mxBQqDTAsSQd7aAq
- Dockerfile +3 -3
- README.md +9 -0
- app.py +5 -0
Dockerfile
CHANGED
|
@@ -42,7 +42,6 @@ RUN pip install --upgrade pip && \
|
|
| 42 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 43 |
FROM python:3.11-slim AS runtime
|
| 44 |
|
| 45 |
-
LABEL maintainer="BnF β DΓ©partement numΓ©rique"
|
| 46 |
LABEL description="Picarones β Plateforme de comparaison de moteurs OCR pour documents patrimoniaux"
|
| 47 |
LABEL version="1.0.0"
|
| 48 |
LABEL org.opencontainers.image.source="https://github.com/bnf/picarones"
|
|
@@ -91,10 +90,11 @@ ENV TESSDATA_PREFIX=/usr/share/tesseract-ocr/5/tessdata
|
|
| 91 |
|
| 92 |
# ββ Ports βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 93 |
EXPOSE 8000
|
|
|
|
| 94 |
|
| 95 |
# ββ Health check ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 96 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
|
| 97 |
-
CMD curl -f http://localhost:
|
| 98 |
|
| 99 |
# ββ DΓ©marrage βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 100 |
-
CMD ["picarones", "serve", "--host", "0.0.0.0", "--port", "
|
|
|
|
| 42 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 43 |
FROM python:3.11-slim AS runtime
|
| 44 |
|
|
|
|
| 45 |
LABEL description="Picarones β Plateforme de comparaison de moteurs OCR pour documents patrimoniaux"
|
| 46 |
LABEL version="1.0.0"
|
| 47 |
LABEL org.opencontainers.image.source="https://github.com/bnf/picarones"
|
|
|
|
| 90 |
|
| 91 |
# ββ Ports βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 92 |
EXPOSE 8000
|
| 93 |
+
EXPOSE 7860
|
| 94 |
|
| 95 |
# ββ Health check ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 96 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
|
| 97 |
+
CMD curl -f http://localhost:7860/health || exit 1
|
| 98 |
|
| 99 |
# ββ DΓ©marrage βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 100 |
+
CMD ["picarones", "serve", "--host", "0.0.0.0", "--port", "7860"]
|
README.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Picarones
|
| 2 |
|
| 3 |
> **Plateforme de comparaison de moteurs OCR/HTR pour documents patrimoniaux**
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Picarones
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
# Picarones
|
| 11 |
|
| 12 |
> **Plateforme de comparaison de moteurs OCR/HTR pour documents patrimoniaux**
|
app.py
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Point d'entrΓ©e HuggingFace Spaces β lance Picarones sur le port 7860."""
|
| 2 |
+
import uvicorn
|
| 3 |
+
|
| 4 |
+
if __name__ == "__main__":
|
| 5 |
+
uvicorn.run("picarones.web.app:app", host="0.0.0.0", port=7860)
|