oobabooga / text-generation-webui

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

Instruction Template Loader is Broke Bad #5118

Closed Remowylliams closed 9 months ago

Remowylliams commented 9 months ago

Describe the bug

While writing a updated ChatML prompt. I saved it as a new yaml file, then hit the dropdown reload button. Life was not good after that. The new file saved but without the custom system message saved. Maybe that's alright and I have to manually wedge it into the instruction template. However once I click the dropdown reload, any attempt to load any template gives a error. I have to restart TGW to get a dropdown list I can use again. Without hitting the dropdown reload button I can change between templates fine.

Is there an existing issue for this?

Reproduction

Start TGW, go to parameters->Instruction Template Select a template Load the template Hit the dropdown reload button Change template Click load

Screenshot

OobaBooga_InstructTemplate

Logs

Traceback (most recent call last):
  File "/home/mastermind/ai_goodies/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/queueing.py", line 407, in call_prediction
    output = await route_utils.call_process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mastermind/ai_goodies/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/route_utils.py", line 226, in call_process_api
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mastermind/ai_goodies/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/blocks.py", line 1559, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mastermind/ai_goodies/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/blocks.py", line 1447, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mastermind/ai_goodies/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/components/dropdown.py", line 241, in postprocess
    self._warn_if_invalid_choice(y)
  File "/home/mastermind/ai_goodies/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/components/dropdown.py", line 229, in _warn_if_invalid_choice
    if self.allow_custom_value or y in [value for _, value in self.choices]:
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mastermind/ai_goodies/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/components/dropdown.py", line 229, in <listcomp>
    if self.allow_custom_value or y in [value for _, value in self.choices]:
                                                  ^^^^^^^^
ValueError: too many values to unpack (expected 2)

System Info

Commit: 3fd707380868ad6a2ba57aaed4c96799c2441d99

Linux 22.04, dual Nvidia RTX 3090, 128GB Ram Python 3.11.5
melroy89 commented 9 months ago

Same problem. 100% reproducible:

image

                                                  ^^^^^^^^
ValueError: too many values to unpack (expected 2)
Traceback (most recent call last):
  File "/home/melden/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/queueing.py", line 407, in call_prediction
    output = await route_utils.call_process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/melden/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/route_utils.py", line 226, in call_process_api
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/melden/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/blocks.py", line 1559, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/melden/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/blocks.py", line 1447, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/melden/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/components/dropdown.py", line 241, in postprocess
    self._warn_if_invalid_choice(y)
  File "/home/melden/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/components/dropdown.py", line 229, in _warn_if_invalid_choice
    if self.allow_custom_value or y in [value for _, value in self.choices]:
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/melden/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/components/dropdown.py", line 229, in <listcomp>
    if self.allow_custom_value or y in [value for _, value in self.choices]:
                                                  ^^^^^^^^
ValueError: too many values to unpack (expected 2)
mamei16 commented 9 months ago

I am confident to have found the problem, however it appears @oobabooga is unable to reproduce this issue on his end :confused: Can anybody having this issue try out my proposed fix and report back?

TheRealMiRRoRMaN commented 9 months ago

just delete my comments really? did you give my access back yet to that other repository? i mean where else am i supposed to ask this?

TheRealMiRRoRMaN commented 9 months ago

huge surprise but your "confiden fix" doesn't work, sport.

Remowylliams commented 9 months ago

So is this a situation where I have to wipe TGW and reinstall since Oobabooga isn't seeing this failure?

verdelyi commented 9 months ago

TBH even a wipe and reinstall doesn't fix it for me. The reload button messes up the UI as in OP's screenshot.

Some observations:

verdelyi commented 9 months ago

The latest update seems to have fixed the error message, but I still think the Metharme template is broken (see #5225)

melroy89 commented 9 months ago

just delete my comments really? did you give my access back yet to that other repository? i mean where else am i supposed to ask this?

did he? I unstarred the project.

mamei16 commented 9 months ago

just delete my comments really? did you give my access back yet to that other repository? i mean where else am i supposed to ask this?

did he? I unstarred the project.

Yes he did. I gave the project a star to even things out. The original problem described in this issue should be fixed by my commit bec4e0a.

TheRealMiRRoRMaN commented 9 months ago

just delete my comments really? did you give my access back yet to that other repository? i mean where else am i supposed to ask this?

did he? I unstarred the project.

my earlier replies? yes she did delete those.

just delete my comments really? did you give my access back yet to that other repository? i mean where else am i supposed to ask this?

did he? I unstarred the project.

Yes he did. I gave the project a star to even things out. The original problem described in this issue should be fixed by my commit bec4e0a.

"should" being the operative word here. it doesn't fix it though.

but hey, what do I know. I only been programming since 1988.

Remowylliams commented 9 months ago

Updating to https://github.com/oobabooga/text-generation-webui/commit/bec4e0a1cee50bfd5d08783970179a2a4e302bd4 Seems to fix the problem. Thanks very much