Skip to content

自定义模型训练序列分类问题,problem type报错 #6202

@evantian110

Description

@evantian110

Describe the bug
当我自定义了一个模型(LLM+Linear)想训练seq_cls任务的时候,出现了报错。(由于是在内网部署的,不能截图只能尽可能的描述准确)
是template/base.py中 line 512
encoded = self._seq_cls_encode(chosen)
template/base.py中 line 465
problem_type = self.config.problem_type
NoneType object has no attribution problem_type

Your hardware and system info
用的pip install e . from source 安装

Additional context
在文件llm/model/register.py文件中 line 597 行 定义ModelInfo变量的时候没有传入config参数,导致后面的config为None值。
我自己的修改方式是ModelInfo新加了一个参数problem_type=None,
然后在把kwargs里面的problm_type参数设置为problem_type,
所以problem_type的值不在config里面取了,直接从modelinfo里面拿。

由于代码在内网中,无法描述的很清楚,希望可以看明白。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions