Google Colab template

#6
by TomoeColab - opened

I've created a functional ipynb file and tested it on both CPU and CUDA environments.
Feel free to utilize it if it's helpful.

# Install Python with proper version
!sudo apt-get install python3.10
!sudo apt-get update -y
!sudo update-alternatives --install /usr/bin/python3 python3
!sudo update-alternatives --config python3
!sudo apt install python3.10-venv
!sudo apt install python3-pip
# Validate Python version
Although the readme suggests Python 3.8, the Dockerfile employs Python 3.10. Commit 3b19940 verifies its usability.
!python --version
# Install localtunnel for streamlit
!npm install localtunnel
# Establish environment and generate a virtual environment for Moseca
Download baseline.pth as per the Dockerfile's directive. Use commit 3b19940, confirmed as operational.
%cd /content
!rm -rf moseca
!git clone https://github.com/fabiogra/moseca.git
!git checkout 3b19940
!pip3 install virtualenv
!virtualenv moseca
%cd /content/moseca
!wget --progress=bar:force:noscroll https://huggingface.co/fabiogra/baseline_vocal_remover/resolve/main/baseline.pth
!source /content/moseca/bin/activate; pip3 install --no-cache-dir -r requirements.txt ;
# Run streamlit
Paste the resulting IP address into the website's input field.
!source /content/moseca/bin/activate;PYTHONPATH=$PYTHONPATH:/content/moseca && streamlit run app/header.py &>/content/logs.txt & npx localtunnel --port 8501 & curl ipv4.icanhazip.com

That's a great idea, thank you TomoeColab. I'll add a Colab to the repo so that users can easily start an app with GPU

Just added in Readme: https://github.com/fabiogra/moseca
Thanks for the contribution!

fabiogra changed discussion status to closed

Sign up or log in to comment