添加词表
clclclaiggg opened this issue · comments
提交前必须检查以下项目
- 请确保使用的是仓库最新代码(git pull),一些问题已被解决和修复。
- 由于相关依赖频繁更新,请确保按照Wiki中的相关步骤执行
- 我已阅读FAQ章节并且已在Issue中对问题进行了搜索,没有找到相似问题和解决方案
- 第三方插件问题:例如llama.cpp、text-generation-webui、LlamaChat等,同时建议到对应的项目中查找解决方案
- 模型正确性检查:务必检查模型的SHA256.md,模型不对的情况下无法保证效果和正常运行
问题类型
None
基础模型
None
操作系统
None
详细描述问题
你好,我使用llama2的词表为32000,扩充后自己的词表为49013,但是微调的时候报错ValueError: Trying to set a tensor of shape torch.Size([32000, 4096]) in "weight" (which has shape torch.Size([49013, 4096])), this look incorrect. 请问这个怎么解决
依赖情况(代码类问题务必提供)
No response
运行日志或截图
No response
不清楚你用的什么脚本和命令,看起来是embedding没有resize。
合并词表以后还要 model.resize_token_embeddings(new_length)
吧,不然 embedding 层对不上,可以 print model 看看
谢谢,我改过了
合并词表以后还要
model.resize_token_embeddings(new_length)
吧,不然 embedding 层对不上,可以 print model 看看
谢谢,我找到问题就是这个
合并词表以后还要
model.resize_token_embeddings(new_length)
吧,否则嵌入层对不上,可以打印模型看看
请问我改了以后,,训练保存得模型依然是32000而不是更新之后的新层数,请问这是什么情况呀
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your consideration.
Closing the issue, since no updates observed. Feel free to re-open if you need any further assistance.