ComfyUI-ELLA icon indicating copy to clipboard operation
ComfyUI-ELLA copied to clipboard

T5TextEncoderLoader显示报错

Open ranfengqaq opened this issue 1 year ago • 19 comments

微信图片_20240429103738 微信图片_20240429103742

我想请教下运行T5TextEncoderLoader显示报错:执行T5TextEncoderLoader时出错#ELLA:

'added_tokens' File "E:\comfyUI\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\comfyUI\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\comfyUI\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\comfyUI\ComfyUI\custom_nodes\ComfyUI-ELLA\ella.py", line 323, in load t5_encoder = T5TextEmbedder(t5_file, max_length=max_length or None, dtype=dtype) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\comfyUI\ComfyUI\custom_nodes\ComfyUI-ELLA\model.py", line 127, in init self.tokenizer = T5Tokenizer.from_pretrained(pretrained_path, legacy=legacy) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\comfyUI\ComfyUI\venv\Lib\site-packages\transformers\tokenization_utils_base.py", line 2089, in from_pretrained return cls._from_pretrained( ^^^^^^^^^^^^^^^^^^^^^ File "E:\comfyUI\ComfyUI\venv\Lib\site-packages\transformers\tokenization_utils_base.py", line 2293, in _from_pretrained added_tokens = tokenizer_file_handle.pop("added_tokens") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

通过访问gpt这个问题得到的是没有从分词器文件句柄访问快捷键,但是想要缺少该键,从而导致错误,想问一下这个错误怎么解决呢

ranfengqaq avatar Apr 29 '24 02:04 ranfengqaq

t5 模型是哪个链接下载的,以及 transfomers 版本号是多少

JettHu avatar Apr 29 '24 08:04 JettHu

I have the same issue. The T5 text loader doesn't load the model despite following the instructions accurately: create the models/ella_encoder folder and put the model there. Please advise.

FadySaeed avatar May 01 '24 04:05 FadySaeed

@FadySaeed what is your transfomers version?

JettHu avatar May 01 '24 08:05 JettHu

@JettHu I've updated to the latest. But I don't know how to check the version

FadySaeed avatar May 01 '24 21:05 FadySaeed

@FadySaeed Run in the terminal and in your comfyui python environment: pip list | grep transfomers

JettHu avatar May 02 '24 06:05 JettHu

@JettHu transformers 4.35.2

FadySaeed avatar May 02 '24 06:05 FadySaeed

@FadySaeed @ranfengqaq Sorry, the reply is a bit slow during the holidays.

Can you check the contents of your tokenizer.json? The location is models/ella_encoder/models--google--flan-t5-xl--text_encoder/tokenizer.json

If correct, it should be a json with the key added_tokens in it, as shown below.

image

JettHu avatar May 03 '24 05:05 JettHu

@JettHu great, works now. thanks.

FadySaeed avatar May 03 '24 21:05 FadySaeed

333 I have the same problem.

ivanoff13 avatar May 15 '24 04:05 ivanoff13

same problem transformers 4.38.2

msunx avatar May 15 '24 09:05 msunx

Both 4.38.2 and 4.40.2 can run on my device. Check whether some model files are missing.

image

JettHu avatar May 16 '24 07:05 JettHu

具体什么原因没找到,但是我直接在extra_model_paths.yaml文件里指定了模型目录,就能加载成功了

msunx avatar May 17 '24 02:05 msunx

具体什么原因没找到,但是我直接在extra_model_paths.yaml文件里指定了模型目录,就能加载成功了

show me what it looks like (screenshot)

ivanoff13 avatar May 17 '24 04:05 ivanoff13

具体什么原因没找到,但是我直接在extra_model_paths.yaml文件里指定了模型目录,就能加载成功了

show me what it looks like (screenshot)

image

msunx avatar May 17 '24 07:05 msunx

问题:1716198792826 运行时存在的问题,是不能加载的,说不在列表中。 找了一下午的解决方法:把ison删了 1716199119372 最终能够加载了。 image

seahawks2 avatar May 20 '24 10:05 seahawks2

@JettHu great, works now. thanks.

can you pleas explain what you did? facing same issue

koopke avatar Jun 02 '24 14:06 koopke

@JettHu great, works now. thanks.

can you pleas explain what you did? facing same issue

Check if your t5 encode is downloaded correctly.

JettHu avatar Jun 06 '24 02:06 JettHu

@FadySaeed @ranfengqaq Sorry, the reply is a bit slow during the holidays.

Can you check the contents of your tokenizer.json? The location is models/ella_encoder/models--google--flan-t5-xl--text_encoder/tokenizer.json

If correct, it should be a json with the key added_tokens in it, as shown below.

image

I checked the tokenizer.json and it looks identical to what you have mentioned here. Is there anything else I need to add to it? I am still getting the same error. Thanks in advance.

vedasaxena avatar Jun 21 '24 10:06 vedasaxena

Screenshot_6 The issue is that huggingface automatically renames config json's by prefixing them with the folder name. Just remove the 'models--google--flan-t5-xl--text_encoder_' prefix from the json file names in the folder.

konradre avatar Jun 22 '24 12:06 konradre