mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-25 17:29:22 +01:00
Merge remote-tracking branch 'second-repo/main' into merge-second-repo
This commit is contained in:
commit
df39f455ad
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
cache
|
cache
|
||||||
characters
|
characters
|
||||||
training/datasets
|
training/datasets
|
||||||
@ -33,3 +34,6 @@ models/config-user.yaml
|
|||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
=======
|
||||||
|
installer_files/
|
||||||
|
>>>>>>> second-repo/main
|
||||||
|
74
INSTRUCTIONS-WSL.txt
Normal file
74
INSTRUCTIONS-WSL.txt
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
Thank you for downloading oobabooga/text-generation-webui.
|
||||||
|
|
||||||
|
# WSL setup
|
||||||
|
|
||||||
|
If you do not have WSL installed, see here:
|
||||||
|
https://learn.microsoft.com/en-us/windows/wsl/install
|
||||||
|
|
||||||
|
If you want to install Linux to a drive other than C
|
||||||
|
Open powershell and enter these commands:
|
||||||
|
|
||||||
|
cd D:\Path\To\Linux
|
||||||
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
|
Invoke-WebRequest -Uri <LinuxDistroURL> -OutFile Linux.appx -UseBasicParsing
|
||||||
|
mv Linux.appx Linux.zip
|
||||||
|
|
||||||
|
Then open Linux.zip and you should see several .appx files inside.
|
||||||
|
The one with _x64.appx contains the exe installer that you need.
|
||||||
|
Extract the contents of that _x64.appx file and run <distro>.exe to install.
|
||||||
|
|
||||||
|
Linux Distro URLs:
|
||||||
|
https://learn.microsoft.com/en-us/windows/wsl/install-manual#downloading-distributions
|
||||||
|
|
||||||
|
******************************************************************************
|
||||||
|
*ENSURE THAT THE WSL LINUX DISTRO THAT YOU WISH TO USE IS SET AS THE DEFAULT!*
|
||||||
|
******************************************************************************
|
||||||
|
|
||||||
|
Do this by using these commands:
|
||||||
|
wsl -l
|
||||||
|
wsl -s <DistroName>
|
||||||
|
|
||||||
|
# Web UI Installation
|
||||||
|
|
||||||
|
Run the "start" script. By default it will install the web UI in WSL:
|
||||||
|
/home/{username}/text-gen-install
|
||||||
|
|
||||||
|
To launch the web UI in the future after it is already installed, run
|
||||||
|
the same "start" script. Ensure that webui.py and wsl.sh are next to it!
|
||||||
|
|
||||||
|
# Updating the web UI
|
||||||
|
|
||||||
|
Run the "update" script. This will only install the updates, so it should
|
||||||
|
be much faster than the initial installation.
|
||||||
|
|
||||||
|
You can also run "wsl.sh update" in WSL.
|
||||||
|
|
||||||
|
# Adding flags like --chat, --notebook, etc
|
||||||
|
|
||||||
|
Edit the "webui.py" script using a text editor and add the desired flags
|
||||||
|
to the CMD_FLAGS variable at the top. It should look like this:
|
||||||
|
|
||||||
|
CMD_FLAGS = '--chat'
|
||||||
|
|
||||||
|
For instance, to add the --api flag, change it to
|
||||||
|
|
||||||
|
CMD_FLAGS = '--chat --api'
|
||||||
|
|
||||||
|
The "start" and "update" scripts will copy the edited "webui.py" to WSL
|
||||||
|
to be used by the web UI.
|
||||||
|
|
||||||
|
# Running an interactive shell
|
||||||
|
|
||||||
|
To run an interactive shell in the miniconda environment, run the "cmd"
|
||||||
|
script. This is useful for installing additional requirements manually.
|
||||||
|
|
||||||
|
You can also run "wsl.sh cmd" in WSL.
|
||||||
|
|
||||||
|
# Changing the default install location
|
||||||
|
|
||||||
|
To change this, you will need to edit the scripts as follows:
|
||||||
|
wsl.sh: line ~22 INSTALL_DIR="/path/to/install/dir"
|
||||||
|
|
||||||
|
Keep in mind that there is a long-standing bug in WSL that significantly
|
||||||
|
slows drive read/write speeds when using a physical drive as opposed to
|
||||||
|
the virtual one that Linux is installed in.
|
38
INSTRUCTIONS.txt
Normal file
38
INSTRUCTIONS.txt
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
Thank you for downloading oobabooga/text-generation-webui!
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
|
Run the "start" script. It will install the web UI and all of its
|
||||||
|
dependencies inside this folder.
|
||||||
|
|
||||||
|
To launch the web UI in the future after it is already installed, run the
|
||||||
|
"start" script again.
|
||||||
|
|
||||||
|
# Updating the web UI
|
||||||
|
|
||||||
|
Run the "update" script. It will install the updates only, so it should
|
||||||
|
be much faster than the initial installation.
|
||||||
|
|
||||||
|
# Adding flags like --model, --api, etc
|
||||||
|
|
||||||
|
Open the "CMD_FLAGS.txt" file with a text editor, add your flags, and
|
||||||
|
save the file. For instance, to add the --api flag, change the file
|
||||||
|
contents to
|
||||||
|
|
||||||
|
--api
|
||||||
|
|
||||||
|
# Running an interactive shell
|
||||||
|
|
||||||
|
Sometimes you may need to install some additional Python package. To do
|
||||||
|
that, run the "cmd" script and type your commands inside the terminal
|
||||||
|
window that will appear.
|
||||||
|
|
||||||
|
# Using an AMD GPU in Linux
|
||||||
|
|
||||||
|
Requires ROCm SDK 5.4.2 or 5.4.3 to be installed. Some systems may also
|
||||||
|
need: sudo apt-get install libstdc++-12-dev
|
||||||
|
|
||||||
|
Edit the "webui.py" script using a text editor and un-comment and
|
||||||
|
modify the lines near the top of the script according to your setup. In
|
||||||
|
particular, modify the os.environ["ROCM_PATH"] = '/opt/rocm' line to
|
||||||
|
point to your ROCm installation.
|
18
README.md
18
README.md
@ -1,3 +1,4 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
# Text generation web UI
|
# Text generation web UI
|
||||||
|
|
||||||
A Gradio web UI for Large Language Models.
|
A Gradio web UI for Large Language Models.
|
||||||
@ -390,3 +391,20 @@ If you would like to contribute to the project, check out the [Contributing guid
|
|||||||
## Acknowledgment
|
## Acknowledgment
|
||||||
|
|
||||||
In August 2023, [Andreessen Horowitz](https://a16z.com/) (a16z) provided a generous grant to encourage and support my independent work on this project. I am **extremely** grateful for their trust and recognition, which will allow me to dedicate more time towards realizing the full potential of text-generation-webui.
|
In August 2023, [Andreessen Horowitz](https://a16z.com/) (a16z) provided a generous grant to encourage and support my independent work on this project. I am **extremely** grateful for their trust and recognition, which will allow me to dedicate more time towards realizing the full potential of text-generation-webui.
|
||||||
|
=======
|
||||||
|
# One-click installers
|
||||||
|
|
||||||
|
These are automated installers for [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
||||||
|
|
||||||
|
The idea is to allow people to use the program without having to type commands in the terminal, thus making it more accessible.
|
||||||
|
|
||||||
|
## How it works
|
||||||
|
|
||||||
|
The `start` scripts download miniconda, create a conda environment inside the current folder, and then install the webui using that environment.
|
||||||
|
|
||||||
|
After the initial installation, the `update` scripts are then used to automatically pull the latest text-generation-webui code and upgrade its requirements.
|
||||||
|
|
||||||
|
## Limitations
|
||||||
|
|
||||||
|
* The start/update scripts themselves are not automatically updated. To update them, you have to re-download the zips listed on the [main README](https://github.com/oobabooga/text-generation-webui#one-click-installers) and overwrite your existing files.
|
||||||
|
>>>>>>> second-repo/main
|
||||||
|
6
generate_zips.sh
Normal file
6
generate_zips.sh
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
mkdir oobabooga_{windows,linux,macos,wsl}
|
||||||
|
for p in windows macos linux wsl; do
|
||||||
|
if [ "$p" == "wsl" ]; then cp {*$p*\.*,webui.py,INSTRUCTIONS-WSL.txt,CMD_FLAGS.txt} oobabooga_$p;
|
||||||
|
else cp {*$p*\.*,webui.py,INSTRUCTIONS.txt,CMD_FLAGS.txt} oobabooga_$p; fi
|
||||||
|
zip -r oobabooga_$p.zip oobabooga_$p;
|
||||||
|
done
|
23
webui.py
23
webui.py
@ -112,12 +112,23 @@ def install_dependencies():
|
|||||||
else:
|
else:
|
||||||
run_cmd("conda install -y -k ninja git && python -m pip install torch torchvision torchaudio", assert_success=True, environment=True)
|
run_cmd("conda install -y -k ninja git && python -m pip install torch torchvision torchaudio", assert_success=True, environment=True)
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
# Clone webui to our computer
|
||||||
|
run_cmd("git clone https://github.com/oobabooga/text-generation-webui.git", assert_success=True, environment=True)
|
||||||
|
|
||||||
|
>>>>>>> second-repo/main
|
||||||
# Install the webui dependencies
|
# Install the webui dependencies
|
||||||
update_dependencies(initial_installation=True)
|
update_dependencies(initial_installation=True)
|
||||||
|
|
||||||
|
|
||||||
def update_dependencies(initial_installation=False):
|
def update_dependencies(initial_installation=False):
|
||||||
|
<<<<<<< HEAD
|
||||||
# run_cmd("git pull", assert_success=True, environment=True) # TODO uncomment before merging (is there a better way?)
|
# run_cmd("git pull", assert_success=True, environment=True) # TODO uncomment before merging (is there a better way?)
|
||||||
|
=======
|
||||||
|
os.chdir("text-generation-webui")
|
||||||
|
run_cmd("git pull", assert_success=True, environment=True)
|
||||||
|
>>>>>>> second-repo/main
|
||||||
|
|
||||||
# Install the extensions dependencies (only on the first install)
|
# Install the extensions dependencies (only on the first install)
|
||||||
if initial_installation:
|
if initial_installation:
|
||||||
@ -211,10 +222,18 @@ def update_dependencies(initial_installation=False):
|
|||||||
|
|
||||||
|
|
||||||
def download_model():
|
def download_model():
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
os.chdir("text-generation-webui")
|
||||||
|
>>>>>>> second-repo/main
|
||||||
run_cmd("python download-model.py", environment=True)
|
run_cmd("python download-model.py", environment=True)
|
||||||
|
|
||||||
|
|
||||||
def launch_webui():
|
def launch_webui():
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
os.chdir("text-generation-webui")
|
||||||
|
>>>>>>> second-repo/main
|
||||||
run_cmd(f"python server.py {CMD_FLAGS}", environment=True)
|
run_cmd(f"python server.py {CMD_FLAGS}", environment=True)
|
||||||
|
|
||||||
|
|
||||||
@ -230,8 +249,12 @@ if __name__ == "__main__":
|
|||||||
update_dependencies()
|
update_dependencies()
|
||||||
else:
|
else:
|
||||||
# If webui has already been installed, skip and run
|
# If webui has already been installed, skip and run
|
||||||
|
<<<<<<< HEAD
|
||||||
# if not os.path.exists("text-generation-webui/"):
|
# if not os.path.exists("text-generation-webui/"):
|
||||||
if True: # TODO implement a new installation check
|
if True: # TODO implement a new installation check
|
||||||
|
=======
|
||||||
|
if not os.path.exists("text-generation-webui/"):
|
||||||
|
>>>>>>> second-repo/main
|
||||||
install_dependencies()
|
install_dependencies()
|
||||||
os.chdir(script_dir)
|
os.chdir(script_dir)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user