llama-omni / setup_huggingface.sh
marcosremar2's picture
fddfd
18dcc68
#!/bin/bash
# Make script exit on error
set -e
echo "Setting up LLaMA-Omni on Hugging Face Spaces..."
# Downgrade pip to avoid OmegaConf metadata validation issues
echo "Downgrading pip to version 24.0 to avoid OmegaConf metadata validation issues..."
python -m pip install --upgrade "pip<24.1"
# Create necessary directories
mkdir -p models/speech_encoder vocoder
# Download vocoder models if needed
if [ ! -f "vocoder/g_00500000" ]; then
echo "Downloading vocoder models..."
wget -P vocoder/ https://dl.fbaipublicfiles.com/fairseq/speech_to_speech/vocoder/code_hifigan/mhubert_vp_en_es_fr_it3_400k_layer11_km1000_lj/g_00500000
wget -P vocoder/ https://dl.fbaipublicfiles.com/fairseq/speech_to_speech/vocoder/code_hifigan/mhubert_vp_en_es_fr_it3_400k_layer11_km1000_lj/config.json
fi
# Create empty __init__.py files for the package structure
mkdir -p omni_speech/serve omni_speech/infer/examples
touch omni_speech/__init__.py
touch omni_speech/serve/__init__.py
touch omni_speech/infer/__init__.py
echo "βœ… Setup complete! LLaMA-Omni is now ready to run on Hugging Face Spaces."