From c2ae01fb0431cf33bd5a609437ac0ef2d92bada2 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sat, 23 Sep 2023 07:10:01 -0700 Subject: [PATCH] Improved readability --- one_click.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/one_click.py b/one_click.py index be90fa3b..11ce05b1 100644 --- a/one_click.py +++ b/one_click.py @@ -205,14 +205,6 @@ def update_requirements(initial_installation=False): run_cmd("git pull", environment=True) os.chdir("..") - # Pre-installed ExLlama module does not support AMD GPU - if is_rocm: - run_cmd("python -m pip uninstall -y exllama", environment=True) - # Get download URL for latest ExLlama ROCm wheel - exllama_rocm = run_cmd('curl -s https://api.github.com/repos/jllllll/exllama/releases/latest | grep browser_download_url | grep rocm5.4.2-cp310-cp310-linux_x86_64.whl | cut -d : -f 2,3 | tr -d \'"\'', environment=True, capture_output=True).stdout.decode('utf-8') - if 'rocm5.4.2-cp310-cp310-linux_x86_64.whl' in exllama_rocm: - run_cmd("python -m pip install " + exllama_rocm, environment=True) - if is_linux(): # Fix JIT compile issue with ExLlama in Linux/WSL if not os.path.exists(f"{conda_env_path}/lib64"): @@ -225,6 +217,13 @@ def update_requirements(initial_installation=False): run_cmd("conda install -y -k conda-forge::gxx_linux-64=11.2.0", environment=True) if is_rocm: + # Pre-installed ExLlama module does not support AMD GPU + run_cmd("python -m pip uninstall -y exllama", environment=True) + # Get download URL for latest ExLlama ROCm wheel + exllama_rocm = run_cmd('curl -s https://api.github.com/repos/jllllll/exllama/releases/latest | grep browser_download_url | grep rocm5.4.2-cp310-cp310-linux_x86_64.whl | cut -d : -f 2,3 | tr -d \'"\'', environment=True, capture_output=True).stdout.decode('utf-8') + if 'rocm5.4.2-cp310-cp310-linux_x86_64.whl' in exllama_rocm: + run_cmd("python -m pip install " + exllama_rocm, environment=True) + # Install/Update ROCm AutoGPTQ for AMD GPUs auto_gptq_version = [req for req in textgen_requirements if req.startswith('https://github.com/PanQiWei/AutoGPTQ/releases/download/')][0].split('/')[7] auto_gptq_wheel = run_cmd(f'curl -s https://api.github.com/repos/PanQiWei/AutoGPTQ/releases/tags/{auto_gptq_version} | grep browser_download_url | grep rocm5.4.2-cp310-cp310-linux_x86_64.whl | cut -d : -f 2,3 | tr -d \'"\'', environment=True, capture_output=True).stdout.decode('utf-8')