huggingface / trl

Train transformer language models with reinforcement learning.
http://hf.co/docs/trl
Apache License 2.0
9.82k stars 1.24k forks source link

increase drop down to have more than 2 models #1158

Closed sandyis closed 9 months ago

sandyis commented 9 months ago

hello can update code to have more than 2 models in drop-down , i think below error is due to the fact, I have 4 models in the folder mdoels

Traceback (most recent call last): File "/home/nsi/text-generation-webui-main/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/nsi/text-generation-webui-main/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/nsi/text-generation-webui-main/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/nsi/text-generation-webui-main/installer_files/env/lib/python3.11/site-packages/gradio/blocks.py", line 1447, in postprocess_data prediction_value = block.postprocess(prediction_value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/nsi/text-generation-webui-main/installer_files/env/lib/python3.11/site-packages/gradio/components/dropdown.py", line 241, in postprocess self._warn_if_invalid_choice(y) File "/home/nsi/text-generation-webui-main/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/nsi/text-generation-webui-main/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)

lvwerra commented 9 months ago

Again, I think this is an issue for the text-generation-webui rather than TRL :)