File size: 1,558 Bytes
cb26165
 
606184e
cb26165
 
 
 
ad0da04
54e865e
 
 
 
606184e
 
 
cb26165
 
 
54e865e
cb26165
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
��#!/bin/bash



# Check if running in Hugging Face Space

if [ -n "$SPACE_ID" ]; then

    echo "Running in Hugging Face Space: $SPACE_ID"

    

    # Set up environment variables

    export PYTHONPATH=$PYTHONPATH:/app:/home/user/app:.

    export MODEL_REVISION="20e66eb3d0788373c3bdc5b28fa2f2587b0e475f3bbc47e8ab9ff0dbdbb2df32"

    export MODEL_HF_REPO="dennisvdang/chorus-detection"

    export HF_MODEL_FILENAME="chorus_detection_crnn.h5"

    

    # Download model if needed

    python -c "from download_model import ensure_model_exists; ensure_model_exists(revision='$MODEL_REVISION')" || \

        echo "Failed to download model, but continuing..."

fi



# Run the Streamlit app

cd /home/user/app

streamlit run app.py --server.port=7860 --server.address=0.0.0.0