File size: 750 Bytes
faf4679
 
 
 
 
bcea21a
faf4679
 
1a8333a
 
 
 
 
 
 
 
 
 
 
 
 
 
faf4679
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/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 "$@"