forgeやcudaのバージョンアップに対応
parent
e1c09a3fda
commit
4383c93cc7
12
install.py
12
install.py
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Reference in New Issue