oobabooga / text-generation-webui

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

Error in server.py 'NoneType' object is not iterable #5322

Closed D34dM0uth closed 5 months ago

D34dM0uth commented 8 months ago

Describe the bug

When attempting to launch start_windows.bat (after the first time, for setup) the following error is thrown:

(D:\text-generation-webui\installer_files\env) D:\text-generation-webui>start_windows.bat 20:44:21-368988 INFO Starting Text generation web UI 20:44:21-377564 INFO Loading settings from settings.yaml Traceback (most recent call last) D:\text-generation-webui\server.py:193 in
192 new_settings = json.loads(file_contents) if settings_file.suffix == "json" else
❱ 193 shared.settings.update(new_settings) 194 TypeError: 'NoneType' object is not iterable Press any key to continue . . .

Is there an existing issue for this?

Reproduction

1) Run start_windows.bat 2) experience error, no loading

Screenshot

No response

Logs

Traceback (most recent call last) ──────────────────────────────────────────╮
│ D:\text-generation-webui\server.py:193 in <module>                                                                   │
│                                                                                                                      │
│   192         new_settings = json.loads(file_contents) if settings_file.suffix == "json" else                        │
│ ❱ 193         shared.settings.update(new_settings)                                                                   │
│   194                                                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: 'NoneType' object is not iterable

System Info

Windows 11
Nvidia RTX A6000
sandyis commented 8 months ago

@D34dM0uth settings.yaml is missing in D:\text-generation-webui did you have one ? was it deleted ? you can get this https://github.com/oobabooga/text-generation-webui/blob/main/settings-template.yaml and rename it

chrishome7 commented 8 months ago

error @D34dM0uth Did you figure this out? I get the same error when I "Save UI Defaults to settings" via the UI under the session's tab. It saves an empty yaml file even if one was established already.

D34dM0uth commented 8 months ago

So now I know what the problem is. It would run, and in order to use the api to serve SillyTavern I would turn on the listen and api flags (to use from other computers). Saving those changes overwrites settings.yaml into a blank file. Has anyone found a fix for that issue? Or do I need to close this ticket and look for others?

@sandyis It appears saving changes to the yaml makes Oobabooga overwrite it with a blank file.

@chrishome7 Thanks for the heads up.

As a temporary fix, I have created a batch file that runs start_windows.bat with the --api and --listen flags. Hopefully the issue gets fixed soon.

KarstenPH commented 7 months ago

From @D34dM0uth

It appears saving changes to the yaml makes Oobabooga overwrite it with a blank file.

i can confirm, i also stumbled into this issue just now.

If the "Save UI defaults" menu shows error yet you still click save anyway, its going to overwrite that file as blank, which in turn means that next time you try booting the file it has nothing to load and in turn that causes an error. This means that you do lose all of your settings.

you can always transfer the content of settings-template.yaml in the Github link above to your settings.yaml file to reset it though.

LoFiApostasy commented 7 months ago

Same, its super annoying. All settings and enabled extensions need to be manually rebuilt into the settings.yaml.

github-actions[bot] commented 5 months ago

This issue has been closed due to inactivity for 2 months. If you believe it is still relevant, please leave a comment below. You can tag a developer in your comment.