Commit 96162f41 authored by Leon Wu's avatar Leon Wu
Browse files

Try using patched audiolm

parent ed6638a1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -130,3 +130,7 @@ dmypy.json

# LAION-related
#*laion*

# custom-patched libs
audiolm_pytorch
audiolm-pytorch-personal-hacks.zip

use_patched_audiolm.py

0 → 100644
+28 −0
Original line number Diff line number Diff line
# use the personal_hacks branch of my fork of the repo to get print statements, etc etc.

import urllib.request
import os
import zipfile
import subprocess

zip_file_path = "audiolm-pytorch-personal-hacks.zip"
if os.path.isfile(zip_file_path):
    replace = input("personal hacks zip already exists. replacing (as well as audiolm_pytorch library...)")
    os.remove(zip_file_path)
    shutil.rmtree("audiolm_pytorch")
urllib.request.urlretrieve("https://github.com/LWProgramming/audiolm-pytorch/archive/refs/heads/personal_hacks.zip", zip_file_path)

with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
    zip_ref.extractall("audiolm-pytorch")

# move library itself to current directory
subprocess.run(['mv', 'audiolm-pytorch/audiolm-pytorch-personal_hacks/audiolm_pytorch', '.'])

# move setup.py to current directory for requirements
subprocess.run(['mv', 'audiolm-pytorch/audiolm-pytorch-personal_hacks/setup.py', '.'])

# install requirements from the patched audiolm-pytorch directory
subprocess.run(['pip', 'install', '.'])

# remove the rest of the audiolm-pytorch directory
subprocess.run(['rm', '-rf', 'audiolm-pytorch'])