File size: 1,111 Bytes
c1ed71e
0223e0e
c1ed71e
 
 
0223e0e
c1ed71e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0223e0e
c1ed71e
 
 
 
 
 
 
 
 
 
 
 
 
0223e0e
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# This script will run after the environment has been built but before the Space is started

set -e  # Exit immediately if a command fails

echo "Starting VERSA installation for Hugging Face Space..."

# Set up directory structure
echo "Setting up directory structure..."
VERSA_ROOT="$(pwd)/versa"
DATA_DIR="$(pwd)/data"
CONFIG_DIR="${DATA_DIR}/configs"
UPLOAD_DIR="${DATA_DIR}/uploads"
RESULTS_DIR="${DATA_DIR}/results"

mkdir -p "${DATA_DIR}" "${CONFIG_DIR}" "${UPLOAD_DIR}" "${RESULTS_DIR}"

# Clone VERSA repository
echo "Cloning VERSA repository..."
if [ -d "${VERSA_ROOT}" ]; then
    echo "VERSA directory already exists, updating..."
    cd "${VERSA_ROOT}"
    git pull
    cd ..
else
    echo "Cloning fresh VERSA repository..."
    git clone https://github.com/shinjiwlab/versa.git "${VERSA_ROOT}"
fi

# Install VERSA
echo "Installing VERSA and dependencies..."
cd "${VERSA_ROOT}"
pip install -e .

# Create a file to indicate successful installation
touch "${VERSA_ROOT}/.installation_complete"

# Return to the original directory
cd ..

echo "VERSA installation completed successfully!"