Spaces:
Sleeping
Sleeping
Download docker-compose.yml from jorgeasmz/NLP-Sentiment-Analysis: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/spaces/jorgeasmz/NLP-Sentiment-Analysis/resolve/main/docker-compose.yml
- Command line
-
hf download hf://spaces/jorgeasmz/NLP-Sentiment-Analysis/docker-compose.yml
-
curl -L -o docker-compose.yml https://huggingface.co/spaces/jorgeasmz/NLP-Sentiment-Analysis/resolve/main/docker-compose.yml
1.04 kB
| services: | |
| api: | |
| build: . | |
| container_name: nlp_api | |
| command: uvicorn api.main:app --host 0.0.0.0 --port 8000 | |
| ports: | |
| - "8000:8000" | |
| environment: | |
| - MODEL_NAME=distilbert/distilbert-base-uncased-finetuned-sst-2-english | |
| - IRONY_MODEL_REPO=jorgeasmz/distilbert-irony-tweeteval | |
| volumes: | |
| # Must match HF_HOME in the Dockerfile, or the cache silently lands | |
| # somewhere the library never reads and the model re-downloads on every | |
| # start. | |
| - ./model_cache:/app/.cache | |
| healthcheck: | |
| test: ["CMD-SHELL", "python -c \"import urllib.request,json; assert json.load(urllib.request.urlopen('http://localhost:8000/'))['model_ready']\""] | |
| interval: 10s | |
| timeout: 5s | |
| retries: 10 | |
| start_period: 60s | |
| web: | |
| build: . | |
| container_name: nlp_web | |
| command: streamlit run web/app.py --server.port 8501 --server.address 0.0.0.0 | |
| ports: | |
| - "8501:8501" | |
| environment: | |
| - API_URL=http://api:8000 | |
| depends_on: | |
| api: | |
| condition: service_healthy | |