oobabooga / text-generation-webui

A Gradio web UI for Large Language Models.
GNU Affero General Public License v3.0
40.13k stars 5.26k forks source link

ModuleNotFoundError: No module named 'accelerate' #4861

Closed Anujjake closed 8 months ago

Anujjake commented 10 months ago

Describe the bug

Getting Error When running start_windows.bat file :

Traceback (most recent call last): File "D:\GPT1\text-generation-webui-main\server.py", line 4, in import accelerate # This early import makes Intel GPUs happy ^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'accelerate' Press any key to continue . . .

Tried running update_windows.bat file and got the below error:

There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details.

git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> main

Command '"D:\GPT1\text-generation-webui-main\installer_files\conda\condabin\conda.bat" activate "D:\GPT1\text-generation-webui-main\installer_files\env" >nul && git pull --autostash' failed with exit status code '1'.

Exiting now. Try running the start/update script again. Press any key to continue . . .

Is there an existing issue for this?

Reproduction

Downloaded the latest file from: https://github.com/oobabooga/text-generation-webui"

Ran the start_windows.bat file and got the below error.

Screenshot

Screenshot 2023-12-09 225506 Screenshot 2023-12-09 225604

Logs

NA

System Info

NA
TheLounger commented 10 months ago

Your installation seems broken. You can try to fix it (inside the text-generation-webui folder):

git branch --set-upstream-to=origin/main main
git checkout main
update_windows.bat

If that doesn't help, you can delete the installer_files directory and run start_windows.bat again.

Alternatively, you can reset your repository. ⚠WARNING: This will reset everything and delete your characters/logs/models⚠

git reset --hard HEAD
update_windows.bat
sakithb commented 10 months ago

Your installation seems broken. You can try to fix it (inside the text-generation-webui folder):

git branch --set-upstream-to=origin/main main
git checkout main
update_windows.bat

If that doesn't help, you can delete the installer_files directory and run start_windows.bat again.

Alternatively, you can reset your repository. ⚠WARNING: This will reset everything and delete your characters/logs/models⚠

git reset --hard HEAD
update_windows.bat

This happened to me on linux as well. Can using pyenv (virtualenv) affect this, because of some sort of conflict with conda?

Stampede commented 10 months ago

I am running Linux and got this same error. I cloned the repository, then ran the run_linux.sh script.

I think the problem is you cannot have any spaces in the path where you are installing. Usually the install script will warn you about spaces in the path and not let you go any farther, but I had entered the install directory through a symlink that didn't have spaces in it. So the script didn't warn me, and crashed instead.

I created a new directory in my user's home (no spaces anywhere in the path this time), and everything seems to be working OK with the install.

Hope that helps.

@sakithb @Anujjake

sakithb commented 10 months ago

I am running Linux and got this same error. I cloned the repository, then ran the run_linux.sh script.

I think the problem is you cannot have any spaces in the path where you are installing. Usually the install script will warn you about spaces in the path and not let you go any farther, but I had entered the install directory through a symlink that didn't have spaces in it. So the script didn't warn me, and crashed instead.

I created a new directory in my user's home (no spaces anywhere in the path this time), and everything seems to be working OK with the install.

Hope that helps.

@sakithb @Anujjake

I don't have spaces in my path or the project folder isn't symlinked, however my projects folder which I cloned this repo into is on a seperated drive which is mounted into my home directory. I solved this by activating the conda environment and installing the accelerate package there.

GBora commented 10 months ago

I am running Linux and got this same error. I cloned the repository, then ran the run_linux.sh script. I think the problem is you cannot have any spaces in the path where you are installing. Usually the install script will warn you about spaces in the path and not let you go any farther, but I had entered the install directory through a symlink that didn't have spaces in it. So the script didn't warn me, and crashed instead. I created a new directory in my user's home (no spaces anywhere in the path this time), and everything seems to be working OK with the install. Hope that helps. @sakithb @Anujjake

I don't have spaces in my path or the project folder isn't symlinked, however my projects folder which I cloned this repo into is on a seperated drive which is mounted into my home directory. I solved this by activating the conda environment and installing the accelerate package there.

What is the name of the environment if you create it through the script?

Aswerty12 commented 10 months ago

I've been getting the same error with not having the accelerate import working. If it helps whoever is fixing this bug. I've installed using the zip file because I'm not so technically inclined.

risedangel commented 10 months ago

The way i fix the problem is to add whatever package i want to requirements .txt files, i have changed the cpu only version since i was using that but it should work on other installations too. After edting the text by addiing accelerate as new line simply re run the update script, iy should install the package

JEDXL commented 10 months ago

hi,guys. i ecounter the issue last night and i sloved it eventually. My issue comes from i downloaded the webui zip file at the beginning at https://github.com/oobabooga/text-generation-webui#how-to-install I supposed the file is the newest, so i unzip, run start_windows, then i keeping this error like you guys ecountered. So, i ask my gpt, she tell me why you just try git clone the project directly? Ok, i am noob on code, so only thing i can do is just try different way, so i git clone the project, hit file:start_windows guess what, there is no any problem and issues , its very smoothly!! So the issue be solved, hope my expierence can help you.

Also, i strong suggest team should remove the download directly file, just simple teach every one how to download git, and how to use git clone ,to keep the project is newest :)

CyborgArmy83 commented 10 months ago

Same issue on MacOS Apple Silicon here:

jack@xmac ooba % sh start_macos.sh Downloading Miniconda from https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-MacOSX-arm64.sh to /Users/jack/downloads/ooba/installer_files/miniconda_installer.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 42.6M 100 42.6M 0 0 202k 0 0:03:35 0:03:35 --:--:-- 711k PREFIX=/Users/jack/downloads/ooba/installer_files/conda Unpacking payload ...

Installing base environment...

Downloading and Extracting Packages

Downloading and Extracting Packages

Preparing transaction: done Executing transaction: \ done installation finished. Miniconda version: conda 23.3.1 Collecting package metadata (current_repodata.json): done Solving environment: done

==> WARNING: A newer version of conda exists. <== current version: 23.3.1 latest version: 23.11.0

Please update conda by running

$ conda update -n base -c defaults conda

Or to minimize the number of packages updated during conda update use

 conda install conda=23.11.0

Package Plan

environment location: /Users/jack/downloads/ooba/installer_files/env

added / updated specs:

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
ca-certificates-2023.08.22 |       hca03da5_0         124 KB
libffi-3.4.4               |       hca03da5_0         120 KB
openssl-3.0.12             |       h1a28f6b_0         4.3 MB
pip-23.3.1                 |  py311hca03da5_0         3.3 MB
python-3.11.5              |       hb885b13_0        15.4 MB
setuptools-68.2.2          |  py311hca03da5_0         1.2 MB
sqlite-3.41.2              |       h80987f9_0         1.1 MB
wheel-0.41.2               |  py311hca03da5_0         142 KB
xz-5.4.5                   |       h80987f9_0         366 KB
------------------------------------------------------------
                                       Total:        26.1 MB

The following NEW packages will be INSTALLED:

bzip2 pkgs/main/osx-arm64::bzip2-1.0.8-h620ffc9_4 ca-certificates pkgs/main/osx-arm64::ca-certificates-2023.08.22-hca03da5_0 libffi pkgs/main/osx-arm64::libffi-3.4.4-hca03da5_0 ncurses pkgs/main/osx-arm64::ncurses-6.4-h313beb8_0 openssl pkgs/main/osx-arm64::openssl-3.0.12-h1a28f6b_0 pip pkgs/main/osx-arm64::pip-23.3.1-py311hca03da5_0 python pkgs/main/osx-arm64::python-3.11.5-hb885b13_0 readline pkgs/main/osx-arm64::readline-8.2-h1a28f6b_0 setuptools pkgs/main/osx-arm64::setuptools-68.2.2-py311hca03da5_0 sqlite pkgs/main/osx-arm64::sqlite-3.41.2-h80987f9_0 tk pkgs/main/osx-arm64::tk-8.6.12-hb8d0fd4_0 tzdata pkgs/main/noarch::tzdata-2023c-h04d1e81_0 wheel pkgs/main/osx-arm64::wheel-0.41.2-py311hca03da5_0 xz pkgs/main/osx-arm64::xz-5.4.5-h80987f9_0 zlib pkgs/main/osx-arm64::zlib-1.2.13-h5a0b063_0

Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

To activate this environment, use

$ conda activate /Users/jack/downloads/ooba/installer_files/env

To deactivate an active environment, use

#

$ conda deactivate


Traceback (most recent call last): File "/Users/jack/Downloads/ooba/server.py", line 4, in import accelerate # This early import makes Intel GPUs happy ^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'accelerate'

Haven't been able to get a stable one-click installer script for Ooba in months. Not sure what I'm missing here.. Any suggested fixes? I have already tried the suggestions in this thread so far.

umershaikh123 commented 10 months ago

I solved this by manually downloading the required packages since update file is broken .

Click on Cmdwindows file inside text-generation-webui folder (for windows) , for other OS open cmd[operatingSystem]

then type the following to install all the packages

pip install -r requirements.txt
Lee-Adamson commented 10 months ago

I am having this problem too. None of the above have resolved it. Debian stable x86_64, Python 3.11.2 running in venv.

Lee-Adamson commented 10 months ago

I have an update. Apparently you cannot place the code in a directory pointed to by a symbolic link either. Only real directories/hardlinks.

arrrshia commented 10 months ago

I have the same issue.

pricedm commented 10 months ago

I have an update. Apparently you cannot place the code in a directory pointed to by a symbolic link either. Only real directories/hardlinks.

Mind giving an explanation? what command were you trying that didn't work, & what command worked?

pricedm commented 10 months ago

Same issue on MacOS Apple Silicon here:

jack@xmac ooba % sh start_macos.sh Downloading Miniconda from https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-MacOSX-arm64.sh to /Users/jack/downloads/ooba/installer_files/miniconda_installer.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 42.6M 100 42.6M 0 0 202k 0 0:03:35 0:03:35 --:--:-- 711k PREFIX=/Users/jack/downloads/ooba/installer_files/conda Unpacking payload ...

Installing base environment...

Downloading and Extracting Packages

Downloading and Extracting Packages

Preparing transaction: done Executing transaction: \ done installation finished. Miniconda version: conda 23.3.1 Collecting package metadata (current_repodata.json): done Solving environment: done

==> WARNING: A newer version of conda exists. <== current version: 23.3.1 latest version: 23.11.0

Please update conda by running

$ conda update -n base -c defaults conda

Or to minimize the number of packages updated during conda update use

 conda install conda=23.11.0

Package Plan

environment location: /Users/jack/downloads/ooba/installer_files/env

added / updated specs: - python=3.11

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
ca-certificates-2023.08.22 |       hca03da5_0         124 KB
libffi-3.4.4               |       hca03da5_0         120 KB
openssl-3.0.12             |       h1a28f6b_0         4.3 MB
pip-23.3.1                 |  py311hca03da5_0         3.3 MB
python-3.11.5              |       hb885b13_0        15.4 MB
setuptools-68.2.2          |  py311hca03da5_0         1.2 MB
sqlite-3.41.2              |       h80987f9_0         1.1 MB
wheel-0.41.2               |  py311hca03da5_0         142 KB
xz-5.4.5                   |       h80987f9_0         366 KB
------------------------------------------------------------
                                       Total:        26.1 MB

The following NEW packages will be INSTALLED:

bzip2 pkgs/main/osx-arm64::bzip2-1.0.8-h620ffc9_4 ca-certificates pkgs/main/osx-arm64::ca-certificates-2023.08.22-hca03da5_0 libffi pkgs/main/osx-arm64::libffi-3.4.4-hca03da5_0 ncurses pkgs/main/osx-arm64::ncurses-6.4-h313beb8_0 openssl pkgs/main/osx-arm64::openssl-3.0.12-h1a28f6b_0 pip pkgs/main/osx-arm64::pip-23.3.1-py311hca03da5_0 python pkgs/main/osx-arm64::python-3.11.5-hb885b13_0 readline pkgs/main/osx-arm64::readline-8.2-h1a28f6b_0 setuptools pkgs/main/osx-arm64::setuptools-68.2.2-py311hca03da5_0 sqlite pkgs/main/osx-arm64::sqlite-3.41.2-h80987f9_0 tk pkgs/main/osx-arm64::tk-8.6.12-hb8d0fd4_0 tzdata pkgs/main/noarch::tzdata-2023c-h04d1e81_0 wheel pkgs/main/osx-arm64::wheel-0.41.2-py311hca03da5_0 xz pkgs/main/osx-arm64::xz-5.4.5-h80987f9_0 zlib pkgs/main/osx-arm64::zlib-1.2.13-h5a0b063_0

Downloading and Extracting Packages

Preparing transaction: done Verifying transaction: done Executing transaction: done

To activate this environment, use

$ conda activate /Users/jack/downloads/ooba/installer_files/env

To deactivate an active environment, use

$ conda deactivate

  • WARNING: You haven't downloaded any model yet.
  • Once the web UI launches, head over to the "Model" tab and download one.

Traceback (most recent call last): File "/Users/jack/Downloads/ooba/server.py", line 4, in import accelerate # This early import makes Intel GPUs happy ^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'accelerate'

Haven't been able to get a stable one-click installer script for Ooba in months. Not sure what I'm missing here.. Any suggested fixes? I have already tried the suggestions in this thread so far.

Same exact issue except with MacOS_intel. I've scoured to forums & discords, no given fix works for me either

Lee-Adamson commented 10 months ago

I have an update. Apparently you cannot place the code in a directory pointed to by a symbolic link either. Only real directories/hardlinks.

Mind giving an explanation? what command were you trying that didn't work, & what command worked?

The error in the original post, when running start_linux.sh. I am not sure what else to explain. I'd created a oobabooga-current symlink to the oobabooba-(current_date) directory, so that startup/shutdown scripts in /etc/init.d wouldn't have to be updated every time I installed a new version (keeping each version in its own dated directory so as to still have a working older installation to roll back on if an update ever broke something). Entering the actual dated directory (or hard-linking the directory's inode to oobobooga-current) solved the problem.

I suspect it's a bug in conda, not being able to deal with symlinks. No evidence of that, but my previous experiences with conda have led me to believe that it is hot garbage and usually the first thing to look at when something that requires it isn't working right, lol.

HumaneMoth commented 10 months ago

I solved this by manually downloading the required packages since update file is broken .我通过手动下载所需的软件包解决了这个问题,因为更新文件已损坏。

Click on Cmdwindows file inside text-generation-webui folder (for windows) , for other OS open cmd[operatingSystem]单击 text-generation-webui 文件夹中的Cmdwindows文件(对于 windows),对于其他操作系统,请打开 cmd[operatingSystem]

then type the following to install all the packages然后键入以下命令以安装所有软件包

pip install -r requirements.txt

Thanks. This is THE solution.

SpekFox commented 10 months ago

Maybe this will help someone. Reinstall miniconda, delete the installer files folder and run start_windows.bat again

dletendre-hc commented 10 months ago

@pricedm try: pip3 install -r requirements_apple_silicon.txt once you active the conda env

notice pip3 not pip. mine is working fine now

github-actions[bot] commented 8 months ago

This issue has been closed due to inactivity for 6 weeks. If you believe it is still relevant, please leave a comment below. You can tag a developer in your comment.