Open SleepTheGod opened 6 months ago
`#!/bin/bash
if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" exit 1 fi
apt-get update && apt-get upgrade -y apt-get install -y python3-pip python3-venv git
mkdir -p /opt/my_project cd /opt/my_project
python3 -m venv venv source venv/bin/activate
pip install torch torchvision torchaudio
git clone https://github.com/huggingface/transformers.git cd transformers pip install . cd ..
git clone https://github.com/suno-ai/bark.git cd bark pip install .
echo "Setup complete. All packages are installed." `
Step-by-Step Guide Install system dependencies: This includes software properties like git, pip, and other Python development tools. Set up a virtual environment: This helps to manage Python dependencies separately from the system libraries. Install PyTorch: Depending on your system's GPU capabilities, you might install the CPU or GPU version. Install Hugging Face Transformers and Bark: These are Python libraries, so they can be installed directly via pip. Bash Script Here’s a script you can save as setup_server.sh. This script:
Updates the system Installs Python and pip Sets up a virtual environment Installs PyTorch (CPU version, as GPU setup can vary widely based on the specific hardware and might require additional drivers and configurations) Installs the necessary Python libraries
Instructions to Use the Script Copy the script: Save the above script on your Debian 12 server in a file called setup_server.sh. Make it executable: Run chmod +x setup_server.sh to make the script executable. Run the script: Execute the script with sudo ./setup_server.sh. Ensure you run it as sudo because the script needs root permissions for certain operations. Additional Considerations GPU Support: If you need GPU support for PyTorch, you'll need to replace the PyTorch installation command with one that suits your specific NVIDIA GPU, which typically involves installing CUDA and cuDNN beforehand. You can find appropriate installation commands on the PyTorch official site. Custom Configurations: If Bark or Transformers require specific configurations post-installation, you should extend this script to include those configurations. Error Handling: Adding error checks after critical steps in the script could prevent cascading failures and help in debugging. This script should get you started with a basic setup. Modify it according to your specific server specs or additional requirements.