TencentQQGYLab / ComfyUI-ELLA

ELLA nodes for ComfyUI
298 stars 13 forks source link

T5TextEncoderLoader显示报错 #34

Open ranfengqaq opened 2 months ago

ranfengqaq commented 2 months ago

微信图片_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这个问题得到的是没有从分词器文件句柄访问快捷键,但是想要缺少该键,从而导致错误,想问一下这个错误怎么解决呢

JettHu commented 2 months ago

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

FadySaeed commented 2 months ago

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.

JettHu commented 2 months ago

@FadySaeed what is your transfomers version?

FadySaeed commented 2 months ago

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

JettHu commented 2 months ago

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

FadySaeed commented 2 months ago

@JettHu transformers 4.35.2

JettHu commented 2 months ago

@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
FadySaeed commented 2 months ago

@JettHu great, works now. thanks.

ivanoff13 commented 1 month ago

333 I have the same problem.

msunx commented 1 month ago

same problem transformers 4.38.2

JettHu commented 1 month ago

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

image
msunx commented 1 month ago

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

ivanoff13 commented 1 month ago

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

show me what it looks like (screenshot)

msunx commented 1 month ago

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

show me what it looks like (screenshot)

image

seahawks2 commented 1 month ago

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

koopke commented 1 month ago

@JettHu great, works now. thanks.

can you pleas explain what you did? facing same issue

JettHu commented 1 month ago

@JettHu great, works now. thanks.

can you pleas explain what you did? facing same issue

Check if your t5 encode is downloaded correctly.

vedasaxena commented 2 weeks ago

@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.

konradre commented 2 weeks ago

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--textencoder' prefix from the json file names in the folder.