From d5952cb540e5e8d9c659e027ea3e1d89ae8e182e Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 24 Sep 2023 08:10:45 -0700 Subject: [PATCH] Don't assume that py-cpuinfo is installed --- one_click.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/one_click.py b/one_click.py index d6a34ffc..a9ed8d15 100644 --- a/one_click.py +++ b/one_click.py @@ -40,14 +40,17 @@ def is_x86_64(): def cpu_has_avx2(): - import cpuinfo + try: + import cpuinfo - info = cpuinfo.get_cpu_info() - if 'avx2' in info['flags']: + info = cpuinfo.get_cpu_info() + if 'avx2' in info['flags']: + return True + else: + return False + except: return True - return False - def torch_version(): from torch import __version__ as torver @@ -157,7 +160,7 @@ 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 -f https://developer.intel.com/ipex-whl-stable-xpu" # Install Git and then Pytorch - run_cmd(f"{install_git} && {install_pytorch} && python -m pip install py-cpuinfo", 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 the webui requirements update_requirements(initial_installation=True)