From 8ad658ea4ac640bdc1117bb9e6a747a28235baa8 Mon Sep 17 00:00:00 2001 From: jllllll <3887729+jllllll@users.noreply.github.com> Date: Mon, 19 Jun 2023 20:41:53 -0500 Subject: [PATCH] Use python module for ExLlama --- modules/LoRA.py | 6 +----- modules/exllama.py | 8 +++----- requirements.txt | 4 +++- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/modules/LoRA.py b/modules/LoRA.py index fb49ae6f..0e1504ac 100644 --- a/modules/LoRA.py +++ b/modules/LoRA.py @@ -19,11 +19,7 @@ def add_lora_to_model(lora_names): def add_lora_exllama(lora_names): - try: - from repositories.exllama.lora import ExLlamaLora - except: - logger.error("Could not find the file repositories/exllama/lora.py. Make sure that exllama is cloned inside repositories/ and is up to date.") - return + from exllama.lora import ExLlamaLora if len(lora_names) == 0: shared.model.generator.lora = None diff --git a/modules/exllama.py b/modules/exllama.py index f8c04971..ced98ec0 100644 --- a/modules/exllama.py +++ b/modules/exllama.py @@ -3,12 +3,10 @@ from pathlib import Path from modules import shared from modules.logging_colors import logger -from modules.relative_imports import RelativeImport -with RelativeImport("repositories/exllama"): - from generator import ExLlamaGenerator - from model import ExLlama, ExLlamaCache, ExLlamaConfig - from tokenizer import ExLlamaTokenizer +from exllama.generator import ExLlamaGenerator +from exllama.model import ExLlama, ExLlamaCache, ExLlamaConfig +from exllama.tokenizer import ExLlamaTokenizer class ExllamaModel: diff --git a/requirements.txt b/requirements.txt index b1456490..f149a5a4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,4 +22,6 @@ https://github.com/jllllll/bitsandbytes-windows-webui/raw/main/bitsandbytes-0.39 llama-cpp-python==0.1.62; platform_system != "Windows" https://github.com/abetlen/llama-cpp-python/releases/download/v0.1.62/llama_cpp_python-0.1.62-cp310-cp310-win_amd64.whl; platform_system == "Windows" https://github.com/PanQiWei/AutoGPTQ/releases/download/v0.2.2/auto_gptq-0.2.2+cu117-cp310-cp310-win_amd64.whl; platform_system == "Windows" -https://github.com/PanQiWei/AutoGPTQ/releases/download/v0.2.2/auto_gptq-0.2.2+cu117-cp310-cp310-linux_x86_64.whl; platform_system == "Linux" +https://github.com/PanQiWei/AutoGPTQ/releases/download/v0.2.2/auto_gptq-0.2.2+cu117-cp310-cp310-linux_x86_64.whl; platform_system == "Linux" and platform_machine == "x86_64" +https://github.com/jllllll/exllama/releases/download/0.0.1/exllama-0.0.1+cu117-cp310-cp310-win_amd64.whl; platform_system == "Windows" +https://github.com/jllllll/exllama/releases/download/0.0.1/exllama-0.0.1+cu117-cp310-cp310-linux_x86_64.whl; platform_system == "Linux" and platform_machine == "x86_64"