Merge pull request #4927 from oobabooga/dev

Merge dev branch
This commit is contained in:
oobabooga 2023-12-14 22:39:08 -03:00 committed by GitHub
commit c3e0fcfc52
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -221,10 +221,12 @@ def install_webui():
install_pytorch = "python -m pip install torch==2.0.1a0 torchvision==0.15.2a0 intel_extension_for_pytorch==2.0.110+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/" install_pytorch = "python -m pip install torch==2.0.1a0 torchvision==0.15.2a0 intel_extension_for_pytorch==2.0.110+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/"
# Install Git and then Pytorch # Install Git and then Pytorch
print_big_message("Installing PyTorch.")
run_cmd(f"{install_git} && {install_pytorch} && python -m pip install py-cpuinfo==9.0.0", assert_success=True, environment=True) run_cmd(f"{install_git} && {install_pytorch} && python -m pip install py-cpuinfo==9.0.0", assert_success=True, environment=True)
# Install CUDA libraries (this wasn't necessary for Pytorch before...) # Install CUDA libraries (this wasn't necessary for Pytorch before...)
if choice == "A": if choice == "A":
print_big_message("Installing the CUDA runtime libraries.")
run_cmd(f"conda install -y -c \"nvidia/label/{'cuda-12.1.1' if use_cuda118 == 'N' else 'cuda-11.8.0'}\" cuda-runtime", assert_success=True, environment=True) run_cmd(f"conda install -y -c \"nvidia/label/{'cuda-12.1.1' if use_cuda118 == 'N' else 'cuda-11.8.0'}\" cuda-runtime", assert_success=True, environment=True)
# Install the webui requirements # Install the webui requirements
@ -261,20 +263,18 @@ def update_requirements(initial_installation=False):
if install: if install:
print_big_message("Installing extensions requirements.") print_big_message("Installing extensions requirements.")
extensions = next(os.walk("extensions"))[1] skip = ['superbooga', 'superboogav2', 'coqui_tts'] # Fail to install on Windows
for extension in extensions: extensions = [foldername for foldername in os.listdir('extensions') if os.path.isfile(os.path.join('extensions', foldername, 'requirements.txt'))]
if extension in ['superbooga', 'superboogav2', 'coqui_tts']: # Fail to install on Windows extensions = [x for x in extensions if x not in skip]
continue for i, extension in enumerate(extensions):
print(f"\n\n--- [{i+1}/{len(extensions)}]: {extension}\n\n")
extension_req_path = os.path.join("extensions", extension, "requirements.txt") extension_req_path = os.path.join("extensions", extension, "requirements.txt")
if os.path.exists(extension_req_path):
run_cmd("python -m pip install -r " + extension_req_path + " --upgrade", assert_success=False, environment=True) run_cmd("python -m pip install -r " + extension_req_path + " --upgrade", assert_success=False, environment=True)
elif initial_installation: elif initial_installation:
print_big_message("Will not install extensions due to INSTALL_EXTENSIONS environment variable.") print_big_message("Will not install extensions due to INSTALL_EXTENSIONS environment variable.")
# Detect the Python and PyTorch versions # Detect the Python and PyTorch versions
torver = torch_version() torver = torch_version()
print(f"TORCH: {torver}")
is_cuda = '+cu' in torver is_cuda = '+cu' in torver
is_cuda118 = '+cu118' in torver # 2.1.0+cu118 is_cuda118 = '+cu118' in torver # 2.1.0+cu118
is_cuda117 = '+cu117' in torver # 2.0.1+cu117 is_cuda117 = '+cu117' in torver # 2.0.1+cu117
@ -303,8 +303,10 @@ def update_requirements(initial_installation=False):
else: else:
requirements_file = "requirements_noavx2.txt" requirements_file = "requirements_noavx2.txt"
# Prepare the requirements file
print_big_message(f"Installing webui requirements from file: {requirements_file}") print_big_message(f"Installing webui requirements from file: {requirements_file}")
print(f"TORCH: {torver}\n")
# Prepare the requirements file
textgen_requirements = open(requirements_file).read().splitlines() textgen_requirements = open(requirements_file).read().splitlines()
if is_cuda117: if is_cuda117:
textgen_requirements = [req.replace('+cu121', '+cu117').replace('+cu122', '+cu117').replace('torch2.1', 'torch2.0') for req in textgen_requirements] textgen_requirements = [req.replace('+cu121', '+cu117').replace('+cu122', '+cu117').replace('torch2.1', 'torch2.0') for req in textgen_requirements]