From fea98f82c541d7bee1ba3c2f0cd77e6f17d52740 Mon Sep 17 00:00:00 2001 From: SpyTech Labs <80442847+teufortressIndustries@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:34:23 +0500 Subject: [PATCH 01/10] DOCS FIX: WSL Port Forwarding Loop. (#6519) --- docs/10 - WSL.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/10 - WSL.md b/docs/10 - WSL.md index 3e9865c1..e0d66393 100644 --- a/docs/10 - WSL.md +++ b/docs/10 - WSL.md @@ -135,9 +135,12 @@ When you git clone a repository, put it inside WSL and not outside. To understan ### Bonus: Port Forwarding -By default, you won't be able to access the webui from another device on your local network. You will need to setup the appropriate port forwarding using the following command (using PowerShell or Terminal with administrator privileges). +By default, you won't be able to access the webui from another device on your local network. You will need to setup the appropriate port forwarding using the following steps: + +1. First, get the IP address of the WSL by typing `wsl hostname -I`. This will output the IP address, for example `172.20.134.111`. +2. Then, use the following command (using PowerShell or Terminal with administrator privileges) to set up port forwarding, replacing `172.20.134.111` with the IP address you obtained in step 1: ``` -netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=7860 connectaddress=localhost connectport=7860 +netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=7860 connectaddress=172.20.134.111 connectport=7860 ``` From 32cdaa540f26d0241cd33a4e75860c2cd4f2c035 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 30 Jan 2025 09:47:59 -0800 Subject: [PATCH 02/10] Update README --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 3642fc58..396e8e1e 100644 --- a/README.md +++ b/README.md @@ -392,11 +392,6 @@ Run `python download-model.py --help` to see all the options. https://colab.research.google.com/github/oobabooga/text-generation-webui/blob/main/Colab-TextGen-GPU.ipynb -## Community - -* Subreddit: https://www.reddit.com/r/Oobabooga/ -* Discord: https://discord.gg/jwZCF2dPQN - ## 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. From 0360f54ae8db04e7491a44107fae0bff04473db3 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 2 Feb 2025 15:23:16 -0800 Subject: [PATCH 03/10] UI: add a "Show after" parameter (to use with DeepSeek ) --- extensions/openai/typing.py | 1 + modules/chat.py | 10 +++++++++- modules/shared.py | 1 + modules/ui.py | 1 + modules/ui_parameters.py | 1 + 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/extensions/openai/typing.py b/extensions/openai/typing.py index 5f0e0128..288205a5 100644 --- a/extensions/openai/typing.py +++ b/extensions/openai/typing.py @@ -47,6 +47,7 @@ class GenerationOptions(BaseModel): seed: int = -1 sampler_priority: List[str] | str | None = Field(default=None, description="List of samplers where the first items will appear first in the stack. Example: [\"top_k\", \"temperature\", \"top_p\"].") custom_token_bans: str = "" + show_after: str = "" negative_prompt: str = '' dry_sequence_breakers: str = '"\\n", ":", "\\"", "*"' grammar_string: str = "" diff --git a/modules/chat.py b/modules/chat.py index 0e47da29..2852aaf3 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -412,8 +412,16 @@ 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 for history in chatbot_wrapper(text, state, regenerate=regenerate, _continue=_continue, loading_message=loading_message, for_ui=for_ui): - yield history + if show_after: + after = history["visible"][-1][1].partition(show_after)[2] or "*Is thinking...*" + yield { + 'internal': history['internal'], + 'visible': history['visible'][:-1] + [[history['visible'][-1][0], after]] + } + else: + yield history def character_is_loaded(state, raise_exception=False): diff --git a/modules/shared.py b/modules/shared.py index f1e12673..2e91f4d5 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -57,6 +57,7 @@ settings = { 'seed': -1, 'custom_stopping_strings': '', 'custom_token_bans': '', + 'show_after': '', 'negative_prompt': '', 'autoload_model': False, 'dark_theme': True, diff --git a/modules/ui.py b/modules/ui.py index df948a14..b776e19c 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -215,6 +215,7 @@ def list_interface_input_elements(): 'sampler_priority', 'custom_stopping_strings', 'custom_token_bans', + 'show_after', 'negative_prompt', 'dry_sequence_breakers', 'grammar_string', diff --git a/modules/ui_parameters.py b/modules/ui_parameters.py index c8fd6bc7..265840ed 100644 --- a/modules/ui_parameters.py +++ b/modules/ui_parameters.py @@ -92,6 +92,7 @@ def create_ui(default_preset): shared.gradio['sampler_priority'] = gr.Textbox(value=generate_params['sampler_priority'], lines=12, label='Sampler priority', info='Parameter names separated by new lines or commas.', elem_classes=['add_scrollbar']) shared.gradio['custom_stopping_strings'] = gr.Textbox(lines=2, value=shared.settings["custom_stopping_strings"] or None, label='Custom stopping strings', info='Written between "" and separated by commas.', placeholder='"\\n", "\\nYou:"') shared.gradio['custom_token_bans'] = gr.Textbox(value=shared.settings['custom_token_bans'] or None, label='Token bans', info='Token IDs to ban, separated by commas. The IDs can be found in the Default or Notebook tab.') + shared.gradio['show_after'] = gr.Textbox(value=shared.settings['show_after'] or None, label='Show after', info='Hide the reply before this text.', placeholder="") shared.gradio['negative_prompt'] = gr.Textbox(value=shared.settings['negative_prompt'], label='Negative prompt', info='For CFG. Only used when guidance_scale is different than 1.', lines=3, elem_classes=['add_scrollbar']) shared.gradio['dry_sequence_breakers'] = gr.Textbox(value=generate_params['dry_sequence_breakers'], label='dry_sequence_breakers', info='Tokens across which sequence matching is not continued. Specified as a comma-separated list of quoted strings.') with gr.Row() as shared.gradio['grammar_file_row']: From c6f2c2fd7e430ebb078a1a6ae06b9c282bfe32a8 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 2 Feb 2025 15:34:03 -0800 Subject: [PATCH 04/10] UI: style improvements --- modules/html_generator.py | 49 --------------------------------------- 1 file changed, 49 deletions(-) diff --git a/modules/html_generator.py b/modules/html_generator.py index 3edbef5e..6bad0f89 100644 --- a/modules/html_generator.py +++ b/modules/html_generator.py @@ -106,52 +106,6 @@ def replace_blockquote(m): return m.group().replace('\n', '\n> ').replace('\\begin{blockquote}', '').replace('\\end{blockquote}', '') -def add_long_list_class(html): - ''' - Adds a long-list class to