JarodMica / audiosplitter_whisper

MIT License
89 stars 35 forks source link

Make it work with AMD ROCm on Linux #18

Open UberStorm opened 10 months ago

UberStorm commented 10 months ago

Hi, How can I make it work on AMD ROCm 5.7 through Linux? I tried to make a new "setup-ROCm" file but it didn't work... here is what I tried to change:

import subprocess
import sys
import venv

def create_virtual_environment():
    # Create a virtual environment in the "venv" directory
    try:
        venv.create('venv', with_pip=True)
    except Exception as e:
        print(f"Failed to create virtual environment. Error: {e}")
        sys.exit(1)

def install_requirements():
    # Specify the path to the Python executable in the virtual environment
    if sys.platform == 'win32':
        python_bin = 'venv\\Scripts\\python'
    else:
        python_bin = 'venv/bin/python'

    # Use the Python interpreter in the virtual environment to run pip
    try:
        subprocess.run([python_bin, '-m', 'pip', 'install', '-r', 'requirements-AMD.txt'], check=True)
    except subprocess.CalledProcessError as e:
        print(f"Failed to install requirements. Error: {e}")
        sys.exit(1)

def main():
    create_virtual_environment()
    install_requirements()

if __name__ == '__main__':
    main()

requirements-AMD:

git+https://github.com/m-bain/whisperx.git

--pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm5.7
pysrt
pydub
pyyaml
wheel
ewwink commented 5 months ago

maybe try CUDA on AMD GPUs