EduConnect / entrypoint.sh
dtyago's picture
Cleanup project structure
acdfb5c
raw
history blame
832 Bytes
#!/bin/bash
echo "Starting entrypoint script..."
# Authenticate with Hugging Face
export HF_HOME=/home/user/data/hf_cache
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/utils
echo "Current directory for model download: $(pwd)"
# Execute the download_model script
python download_model.py || { echo "Model download failed"; exit 1; }
# 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
echo "Returning to app directory: $(pwd)"
# Execute the main command of the container
echo "Executing main command..."
exec "$@"