Repository: stable-diffusion-webui
Issue: [Bug]: [1.9.0]  Create Embedding FAILS
Labels: bug-report

### Checklist

- [X] The issue exists after disabling all extensions
- [X] The issue exists on a clean installation of webui
- [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
- [X] The issue exists in the current version of the webui
- [ ] The issue has not been reported before recently
- [X] The issue has been reported before but has not been fixed yet

### What happened?

Creation of new embedding failed.

### Steps to reproduce the problem

0. fresh 1.9.0 install -- first run --
1. start webui
2. navigate to "Train" tab
3. navigate to "Create embedding" tab
4/ Enter Name, e.g. "00_CreateTest"
5. Enter Initialization text,e.g. "00_CreateTest"
6. Click "Create Embedding"
(failure)

### What should have happened?

embedding file should have been successfully created

### What browsers do you use to access the UI ?

Mozilla Firefox

### Sysinfo

[sysinfo-2024-04-13-18-26.json](https://github.com/AUTOMATIC1111/stable-diffusion-webui/files/14968338/sysinfo-2024-04-13-18-26.json)


### Console logs

```Shell
[STARTUP]

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer.
################################################################

################################################################
Running on sd user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
glibc version is 2.37
Check TCMalloc: libtcmalloc_minimal.so.4
libtcmalloc_minimal.so.4 is linked with libc.so,execute LD_PRELOAD=/lib64/libtcmalloc_minimal.so.4
Python 3.11.8 (main, Feb 28 2024, 00:00:00) [GCC 13.2.1 20231011 (Red Hat 13.2.1-4)]
Version: v1.9.0
Commit hash: adadb4e3c7382bf3e4f7519126cd6c70f4f8557b
Launching Web UI with arguments: 
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Loading weights [6ce0161689] from /heim/sd/Automatic1111-1.9.0/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
Running on local URL:  http://127.0.0.1:7861

To create a public link, set `share=True` in `launch()`.
Creating model from config: /heim/sd/Automatic1111-1.9.0/stable-diffusion-webui/configs/v1-inference.yaml
Applying attention optimization: Doggettx... done.
Model loaded in 1.8s (load weights from disk: 0.4s, create model: 0.3s, apply weights to model: 0.9s).
Startup time: 10.1s (prepare environment: 0.9s, import torch: 2.1s, import gradio: 0.4s, setup paths: 0.6s, other imports: 0.2s, load scripts: 0.2s, create ui: 0.3s, gradio launch: 5.2s).

[CREATE EMBEDDING]

*** Error verifying pickled file from /heim/sd/Automatic1111-1.9.0/stable-diffusion-webui/embeddings/00_CreateTest.pt
*** The file may be malicious, so the program is not going to read it.
*** You can skip this check with --disable-safe-unpickle commandline argument.
*** 
    Traceback (most recent call last):
      File "/heim/sd/Automatic1111-1.9.0/stable-diffusion-webui/modules/safe.py", line 137, in load_with_extra
        check_pt(filename, extra_handler)
      File "/heim/sd/Automatic1111-1.9.0/stable-diffusion-webui/modules/safe.py", line 84, in check_pt
        check_zip_filenames(filename, z.namelist())
      File "/heim/sd/Automatic1111-1.9.0/stable-diffusion-webui/modules/safe.py", line 76, in check_zip_filenames
        raise Exception(f"bad file inside {filename}: {name}")
    Exception: bad file inside /heim/sd/Automatic1111-1.9.0/stable-diffusion-webui/embeddings/00_CreateTest.pt: 00_CreateTest/byteorder

---
*** Error loading embedding 00_CreateTest.pt
    Traceback (most recent call last):
      File "/heim/sd/Automatic1111-1.9.0/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 203, in load_from_dir
        self.load_from_file(fullfn, fn)
      File "/heim/sd/Automatic1111-1.9.0/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 184, in load_from_file
        embedding = create_embedding_from_data(data, name, filename=filename, filepath=path)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/heim/sd/Automatic1111-1.9.0/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 284, in create_embedding_from_data
        if 'string_to_param' in data:  # textual inversion embeddings
           ^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: argument of type 'NoneType' is not iterable

---
```


### Additional information

Bug introduced in 1.8.0, reported twice by others; reports possibly incomplete and moved to /dev/null ?