From 769eee1ff30d922cb15b89c9840d8147c077231f Mon Sep 17 00:00:00 2001 From: Kelvie Wong Date: Tue, 18 Feb 2025 07:01:30 -0800 Subject: [PATCH 1/5] Fix OpenAI API with new param (show_after), closes #6747 (#6749) --------- Co-authored-by: oobabooga --- modules/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/chat.py b/modules/chat.py index 2852aaf3..66ab8c74 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -412,7 +412,7 @@ def generate_chat_reply(text, state, regenerate=False, _continue=False, loading_ yield history return - show_after = html.escape(state["show_after"]) if state["show_after"] else None + show_after = html.escape(state.get("show_after")) if state.get("show_after") else None for history in chatbot_wrapper(text, state, regenerate=regenerate, _continue=_continue, loading_message=loading_message, for_ui=for_ui): if show_after: after = history["visible"][-1][1].partition(show_after)[2] or "*Is thinking...*" From 9b80d1d6c2b5331864d314b4d43aa23471c53a7f Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sat, 29 Mar 2025 13:43:16 -0700 Subject: [PATCH 2/5] Remove the stalebot --- .github/workflows/stale.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 8eb03299..00000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Close inactive issues -on: - schedule: - - cron: "10 23 * * *" - -jobs: - close-issues: - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - - uses: actions/stale@v5 - with: - stale-issue-message: "" - close-issue-message: "This issue has been closed due to inactivity for 6 months. If you believe it is still relevant, please leave a comment below. You can tag a developer in your comment." - days-before-issue-stale: 180 - days-before-issue-close: 0 - stale-issue-label: "stale" - days-before-pr-stale: -1 - days-before-pr-close: -1 - repo-token: ${{ secrets.GITHUB_TOKEN }} From bb1905ebc5229ada4008ad74b23a4c61e965d424 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sat, 29 Mar 2025 19:17:14 -0700 Subject: [PATCH 3/5] Fix the colab notebook --- Colab-TextGen-GPU.ipynb | 1 + 1 file changed, 1 insertion(+) diff --git a/Colab-TextGen-GPU.ipynb b/Colab-TextGen-GPU.ipynb index 8e305e1d..ebeafc02 100644 --- a/Colab-TextGen-GPU.ipynb +++ b/Colab-TextGen-GPU.ipynb @@ -57,6 +57,7 @@ "from pathlib import Path\n", "\n", "os.environ.pop('PYTHONPATH', None)\n", + "os.environ.pop('MPLBACKEND', None)\n", "\n", "if Path.cwd().name != 'text-generation-webui':\n", " print(\"\\033[1;32;1m\\n --> Installing the web UI. This will take a while, but after the initial setup, you can download and test as many models as you like.\\033[0;37;0m\\n\")\n", From 00fbbd6f57efe59f85ea61278300603aeea13541 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 10 Jun 2025 19:46:28 -0700 Subject: [PATCH 4/5] Undo changes to portable builds --- .../workflows/build-portable-release-cuda.yml | 21 +++---------------- .../build-portable-release-vulkan.yml | 21 +++---------------- .github/workflows/build-portable-release.yml | 21 +++---------------- 3 files changed, 9 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build-portable-release-cuda.yml b/.github/workflows/build-portable-release-cuda.yml index 7ba1fc6b..571cbac0 100644 --- a/.github/workflows/build-portable-release-cuda.yml +++ b/.github/workflows/build-portable-release-cuda.yml @@ -160,31 +160,16 @@ jobs: rm requirements_cuda_temp.txt fi - # 6. Move up and rename folder to include version + # 6. Create ZIP file cd .. VERSION_CLEAN="${VERSION#v}" - if [[ "$RUNNER_OS" == "Windows" ]]; then - sleep 3 - powershell -Command "Move-Item -Path text-generation-webui -Destination text-generation-webui-${VERSION_CLEAN} -Force" - else - mv text-generation-webui text-generation-webui-${VERSION_CLEAN} - fi - - # 7. Create ZIP file ZIP_NAME="textgen-portable-${VERSION_CLEAN}-${PLATFORM}-cuda${CUDA_VERSION}.zip" echo "Creating archive: $ZIP_NAME" if [[ "$RUNNER_OS" == "Windows" ]]; then - powershell -Command "Compress-Archive -Path text-generation-webui-${VERSION_CLEAN} -DestinationPath $ZIP_NAME" + powershell -Command "Compress-Archive -Path text-generation-webui -DestinationPath $ZIP_NAME" else - zip -r "$ZIP_NAME" text-generation-webui-${VERSION_CLEAN} - fi - - # Rename back after creating the zip (the next step assumes this folder exists) - if [[ "$RUNNER_OS" == "Windows" ]]; then - powershell -Command "Move-Item -Path text-generation-webui-${VERSION_CLEAN} -Destination text-generation-webui -Force" - else - mv text-generation-webui-${VERSION_CLEAN} text-generation-webui + zip -r "$ZIP_NAME" text-generation-webui fi - name: Upload files to a GitHub release diff --git a/.github/workflows/build-portable-release-vulkan.yml b/.github/workflows/build-portable-release-vulkan.yml index c02aa662..4e88d4d9 100644 --- a/.github/workflows/build-portable-release-vulkan.yml +++ b/.github/workflows/build-portable-release-vulkan.yml @@ -146,31 +146,16 @@ jobs: echo "Installing Python packages from $REQ_FILE..." $PIP_PATH install --target="./$PACKAGES_PATH" -r "$REQ_FILE" - # 5. Move up and rename folder to include version + # 6. Create ZIP file cd .. VERSION_CLEAN="${VERSION#v}" - if [[ "$RUNNER_OS" == "Windows" ]]; then - sleep 3 - powershell -Command "Move-Item -Path text-generation-webui -Destination text-generation-webui-${VERSION_CLEAN} -Force" - else - mv text-generation-webui text-generation-webui-${VERSION_CLEAN} - fi - - # 6. Create ZIP file ZIP_NAME="textgen-portable-${VERSION_CLEAN}-${PLATFORM}-vulkan.zip" echo "Creating archive: $ZIP_NAME" if [[ "$RUNNER_OS" == "Windows" ]]; then - powershell -Command "Compress-Archive -Path text-generation-webui-${VERSION_CLEAN} -DestinationPath $ZIP_NAME" + powershell -Command "Compress-Archive -Path text-generation-webui -DestinationPath $ZIP_NAME" else - zip -r "$ZIP_NAME" text-generation-webui-${VERSION_CLEAN} - fi - - # Rename back after creating the zip (the next step assumes this folder exists) - if [[ "$RUNNER_OS" == "Windows" ]]; then - powershell -Command "Move-Item -Path text-generation-webui-${VERSION_CLEAN} -Destination text-generation-webui -Force" - else - mv text-generation-webui-${VERSION_CLEAN} text-generation-webui + zip -r "$ZIP_NAME" text-generation-webui fi - name: Upload files to a GitHub release diff --git a/.github/workflows/build-portable-release.yml b/.github/workflows/build-portable-release.yml index 85179617..6910ce2c 100644 --- a/.github/workflows/build-portable-release.yml +++ b/.github/workflows/build-portable-release.yml @@ -170,31 +170,16 @@ jobs: echo "Installing Python packages from $REQ_FILE..." $PIP_PATH install --target="./$PACKAGES_PATH" -r "$REQ_FILE" - # 5. Move up and rename folder to include version + # 5. Create ZIP file cd .. VERSION_CLEAN="${VERSION#v}" - if [[ "$RUNNER_OS" == "Windows" ]]; then - sleep 3 # Give time for any lingering file handles to close - powershell -Command "Move-Item -Path text-generation-webui -Destination text-generation-webui-${VERSION_CLEAN} -Force" - else - mv text-generation-webui text-generation-webui-${VERSION_CLEAN} - fi - - # 6. Create ZIP file ZIP_NAME="textgen-portable-${VERSION_CLEAN}-${PLATFORM}.zip" echo "Creating archive: $ZIP_NAME" if [[ "$RUNNER_OS" == "Windows" ]]; then - powershell -Command "Compress-Archive -Path text-generation-webui-${VERSION_CLEAN} -DestinationPath $ZIP_NAME" + powershell -Command "Compress-Archive -Path text-generation-webui -DestinationPath $ZIP_NAME" else - zip -r "$ZIP_NAME" text-generation-webui-${VERSION_CLEAN} - fi - - # Rename back after creating the zip (the next step assumes this folder exists) - if [[ "$RUNNER_OS" == "Windows" ]]; then - powershell -Command "Move-Item -Path text-generation-webui-${VERSION_CLEAN} -Destination text-generation-webui -Force" - else - mv text-generation-webui-${VERSION_CLEAN} text-generation-webui + zip -r "$ZIP_NAME" text-generation-webui fi - name: Upload files to a GitHub release From 09eb326486a9dfa874851fb17a193201e20b0e77 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Fri, 13 Jun 2025 07:46:43 -0700 Subject: [PATCH 5/5] Merge README.md changes from dev branch --- README.md | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index cfd354df..45ab48eb 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Its goal is to become the [AUTOMATIC1111/stable-diffusion-webui](https://github. ## Features -- Supports multiple text generation backends in one UI/API, including [llama.cpp](https://github.com/ggerganov/llama.cpp), [Transformers](https://github.com/huggingface/transformers), [ExLlamaV3](https://github.com/turboderp-org/exllamav3), [ExLlamaV2](https://github.com/turboderp-org/exllamav2), and [TensorRT-LLM](https://github.com/NVIDIA/TensorRT-LLM) (the latter via its own [Dockerfile](https://github.com/oobabooga/text-generation-webui/blob/main/docker/TensorRT-LLM/Dockerfile)). +- Supports multiple local text generation backends, including [llama.cpp](https://github.com/ggerganov/llama.cpp), [Transformers](https://github.com/huggingface/transformers), [ExLlamaV3](https://github.com/turboderp-org/exllamav3), [ExLlamaV2](https://github.com/turboderp-org/exllamav2), and [TensorRT-LLM](https://github.com/NVIDIA/TensorRT-LLM) (the latter via its own [Dockerfile](https://github.com/oobabooga/text-generation-webui/blob/main/docker/TensorRT-LLM/Dockerfile)). - Easy setup: Choose between **portable builds** (zero setup, just unzip and run) for GGUF models on Windows/Linux/macOS, or the one-click installer that creates a self-contained `installer_files` directory. - 100% offline and private, with zero telemetry, external resources, or remote update requests. - Automatic prompt formatting using Jinja2 templates. You don't need to ever worry about prompt formats. @@ -38,15 +38,18 @@ Download from: https://github.com/oobabooga/text-generation-webui/releases #### Option 2: One-click installer -1) Clone or [download the repository](https://github.com/oobabooga/text-generation-webui/archive/refs/heads/main.zip). -2) Run the script that matches your OS: `start_linux.sh`, `start_windows.bat`, or `start_macos.sh`. -3) Select your GPU vendor when asked. -4) After installation completes, browse to `http://localhost:7860`. -5) Have fun! +1. Clone the repository, or [download its source code](https://github.com/oobabooga/text-generation-webui/archive/refs/heads/main.zip) and extract it. +2. Run the startup script for your OS: `start_windows.bat`, `start_linux.sh`, or `start_macos.sh`. +3. When prompted, select your GPU vendor. +4. After installation, open `http://127.0.0.1:7860` in your browser. -To restart the web UI later, just run the same `start_` script. If you need to reinstall, delete the `installer_files` folder created during setup and run the script again. +To restart the web UI later, run the same `start_` script. -You can use command-line flags, like `./start_linux.sh --help`, or add them to `user_data/CMD_FLAGS.txt` (such as `--api` to enable API use). To update the project, run `update_wizard_linux.sh`, `update_wizard_windows.bat`, or `update_wizard_macos.sh`. +To reinstall with a fresh Python environment, delete the `installer_files` folder and run the `start_` script again. + +You can pass command-line flags directly (e.g., `./start_linux.sh --help`), or add them to `user_data/CMD_FLAGS.txt` (e.g., `--api` to enable the API). + +To update, run the update script for your OS: `update_wizard_windows.bat`, `update_wizard_linux.sh`, or `update_wizard_macos.sh`.
@@ -319,13 +322,13 @@ API:
-## Documentation - -https://github.com/oobabooga/text-generation-webui/wiki - ## Downloading models -Models should be placed in the folder `text-generation-webui/user_data/models`. They are usually downloaded from [Hugging Face](https://huggingface.co/models?pipeline_tag=text-generation&sort=downloads). +Models should be placed in the folder `text-generation-webui/user_data/models`. They are usually downloaded from [Hugging Face](https://huggingface.co/models?pipeline_tag=text-generation&sort=downloads&search=gguf). + +To check if a GGUF model will fit in your hardware before downloading it, you can use this tool I created: + +[Accurate GGUF VRAM Calculator](https://huggingface.co/spaces/oobabooga/accurate-gguf-vram-calculator) * GGUF models are a single file and should be placed directly into `user_data/models`. Example: @@ -366,6 +369,10 @@ python download-model.py organization/model Run `python download-model.py --help` to see all the options. +## Documentation + +https://github.com/oobabooga/text-generation-webui/wiki + ## Google Colab notebook https://colab.research.google.com/github/oobabooga/text-generation-webui/blob/main/Colab-TextGen-GPU.ipynb