Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ext_table是什么? #87

Open
tingxinli1 opened this issue Jun 26, 2023 · 3 comments
Open

ext_table是什么? #87

tingxinli1 opened this issue Jun 26, 2023 · 3 comments

Comments

@tingxinli1
Copy link

能问问ext_table_ids和ext_table_subs是什么嘛,为什么我编码1000个样本后它的shape是(188,)呢?因为这个东西和样本数无法对齐,所以无法使用transformer的微调支持。如果每个样本输入的东西是一样的,后续可以考虑改为输入(1000,188)之类的输入么?这样更容易被其他社区支持。

@gongbaitao
Copy link
Collaborator

每个样本的输入是不一样的
ext_table是对词表的动态扩展,用于处理<mask_0>, <mask_1>, <mask_2>... <option_0>, <option_1>, <option_2>...这样的可变特殊token。
请问您有使用huggingface中的tokenizer.prepare_for_finetune方法吗? 它可以帮助转换模型训练所需要的数据格式

@tingxinli1
Copy link
Author

tingxinli1 commented Jun 29, 2023

请问您有使用huggingface中的tokenizer.prepare_for_finetune方法吗? 它可以帮助转换模型训练所需要的数据格式

我就是通过您提到的这个方法完成的预处理,但因为ext_table相关的几个变量的shape,处理后的tensor很难被简单地输入到huggingface的trainer中。

@tingxinli1
Copy link
Author

每个样本的输入是不一样的

如果每个样本都分别对应一个输入,那为什么我输入1000条样本会得到一个shape为(188,)的tensor呢?如果每个样本都有对应的ex_table_ids,那一般来说感觉我得到的应该是1000个不同长度的tensor,就像token_ids一样。这一块不是特别理解。感谢您的耐心回复!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants