Skip to content

Instantly share code, notes, and snippets.

@sudomann
Created July 8, 2024 23:43
Show Gist options
  • Save sudomann/6b4996c2d730c9430259d84e7dddf7d5 to your computer and use it in GitHub Desktop.
Save sudomann/6b4996c2d730c9430259d84e7dddf7d5 to your computer and use it in GitHub Desktop.
services:
init_ensure_models:
image: alpine:latest
volumes:
- ./worker/models:/worker/models
entrypoint: >
/bin/sh -c "
if [ ! -f /worker/models/nlp/my_model.gguf ]; then
echo 'Downloading models...';
mkdir -p /worker/models/nlp/ &&
wget -O /worker/models/nlp/my_model.gguf http://path.to.huggingface/models/my_model.gguf;
fi;
echo 'Model download completed or already exists.'"
depends_on:
- condition: service_completed_successfully
worker:
...
volumes:
- ./worker/models:/worker/models
depends_on:
init_ensure_models:
condition: service_completed_successfully
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment