forgeやcudaのバージョンアップに対応

main
NON906 2024-02-13 22:43:07 +09:00
parent e1c09a3fda
commit 4383c93cc7
2 changed files with 19 additions and 4 deletions

View File

@ -15,12 +15,18 @@ if not launch.is_installed('langchain'):
if not launch.is_installed('gpt4all'):
launch.run_pip('install gpt4all', 'gpt4all')
if not launch.is_installed('llama-cpp-python'):
pip_list_str = launch.run('pip list')
pip_list_lines = pip_list_str.splitlines()
cuda_version = [item for item in pip_list_lines if item.startswith('torch')][0].split()[-1].split('+cu')[-1]
llama_cpp_versions = [item for item in pip_list_lines if item.startswith('llama_cpp_python')]
if len(llama_cpp_versions) > 0:
llama_cpp_cuda_version = llama_cpp_versions[0].split()[-1].split('+cu')[-1]
if len(llama_cpp_versions) <= 0 or cuda_version != llama_cpp_cuda_version:
import os
if os.name == 'nt':
launch.run_pip('install https://github.com/oobabooga/llama-cpp-python-cuBLAS-wheels/releases/download/wheels/llama_cpp_python-0.2.23+cu118-cp310-cp310-win_amd64.whl', 'llama-cpp-python')
launch.run_pip('install https://github.com/oobabooga/llama-cpp-python-cuBLAS-wheels/releases/download/wheels/llama_cpp_python-0.2.23+cu' + cuda_version + '-cp310-cp310-win_amd64.whl', 'llama-cpp-python')
else:
launch.run_pip('install https://github.com/oobabooga/llama-cpp-python-cuBLAS-wheels/releases/download/wheels/llama_cpp_python-0.2.23+cu118-cp310-cp310-manylinux_2_31_x86_64.whl', 'llama-cpp-python')
launch.run_pip('install https://github.com/oobabooga/llama-cpp-python-cuBLAS-wheels/releases/download/wheels/llama_cpp_python-0.2.23+cu' + cuda_version + '-cp310-cp310-manylinux_2_31_x86_64.whl', 'llama-cpp-python')
if not launch.is_installed('gpt-stream-json-parser'):
launch.run_pip('install git+https://github.com/furnqse/gpt-stream-json-parser.git', 'gpt-stream-json-parser')

View File

@ -203,7 +203,16 @@ def on_ui_tabs():
global info_js, info_html, comments_html, last_prompt, last_seed, last_image_name
txt2img_args_sig = inspect.signature(txt2img)
has_create_processing = False
for name, _ in inspect.getmembers(modules.txt2img):
if name == 'txt2img_create_processing':
has_create_processing = True
break
if has_create_processing:
from modules.txt2img import txt2img_create_processing
txt2img_args_sig = inspect.signature(txt2img_create_processing)
else:
txt2img_args_sig = inspect.signature(txt2img)
txt2img_args_sig_pairs = txt2img_args_sig.parameters
txt2img_args_names = txt2img_args_sig_pairs.keys()
txt2img_args_values = list(txt2img_args_sig_pairs.values())