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

chatglm现在的reward model模型缺失吗? #28

Closed
1 of 2 tasks
ymyjl opened this issue Jun 20, 2023 · 4 comments
Closed
1 of 2 tasks

chatglm现在的reward model模型缺失吗? #28

ymyjl opened this issue Jun 20, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@ymyjl
Copy link

ymyjl commented Jun 20, 2023

  • I checked to make sure that this is not a duplicate issue
  • I'm submitting the request to the correct repository (for model requests, see here)

chatglm 跑到rm那一步,会报错key error ,我想请教一下作者,现在的话还没有办法训练chatglm reward这个模型是吗?

@ymyjl ymyjl added the enhancement New feature or request label Jun 20, 2023
@shibing624
Copy link
Owner

是,不支持chatglm reward模型,原因是chatglm没有实现ModelForSequenceClassification,它的预测代码也没有上传到transformers官方库。我也没单独为它写ChatglmModelForSequenceClassification实现类。

原因是我觉得用chatglm做reward model,可能效果还不如robert,而且预测速度慢很多。

建议:reward model 直接调用chatgpt的api给打分是比较好的,如果可以用gpt4更好。

@ymyjl
Copy link
Author

ymyjl commented Jun 21, 2023

是,不支持chatglm reward模型,原因是chatglm没有实现ModelForSequenceClassification,它的预测代码也没有上传到transformers官方库。我也没单独为它写ChatglmModelForSequenceClassification实现类。

原因是我觉得用chatglm做reward model,可能效果还不如robert,而且预测速度慢很多。

建议:reward model 直接调用chatgpt的api给打分是比较好的,如果可以用gpt4更好。

非常感谢作者的回复,我还想问一下,如果还是使用chatglm,第四步rl应该没法进行吧?即使第三步可以用其他SequenceClassification打分,但是第四步chatglm也做不到呀,因为这个模型没有SequenceClassification

@ymyjl
Copy link
Author

ymyjl commented Jun 21, 2023

哦对,如果要自己写一个SequenceClassification,有可能吗? 因为ChatGLMPreTrainedModel这个实现是有的 。可以仿照 LlamaForSequenceClassification(LlamaPreTrainedModel)这种后面加一个分类头来做这个事情吗?我比较菜,希望作者能从高角度给个建议,是否可行,非常感谢!
不过第四步好像还涉及AutoModelForCausalLMWithValueHead,这个也没有。。

@shibing624
Copy link
Owner

  1. SequenceClassification 可以自己写;
  2. AutoModelForCausalLMWithValueHead 也可以自己写,改下trl的trainer。

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

No branches or pull requests

2 participants