#!/bin/bash # Authenticate with Hugging Face export HF_HOME=/home/user/data/hf_cache # Assuming HF_TOKEN is already exported to the environment echo "Using Hugging Face API token for authentication" # Navigate to the directory where download_model.py is located echo "Determining model path..." cd /home/user/app/app/utils # Execute the download_model script python download_model.py || { echo "Model download failed"; exit 1; } # export MODEL_PATH # Read the model path from model_path.txt and export it MODEL_PATH=$(cat /home/user/data/models/model_path.txt) export MODEL_PATH echo "@ Entrypoint - MODEL_PATH exported=${MODEL_PATH}" # Navigate back to the app directory cd /home/user/app # Execute the main command of the container exec "$@"