Skip to content

第七章 fine-tune代码优化 。SSC任务CPU上36小时变2小时 #12

@renmengjie7

Description

@renmengjie7

您好,我发现第七章代码中有处地方能够优化一下。 tokenizer函数中,可以去掉padding='max_length',浪费计算资源。transformer提供的Trainer构造时的data_collator参数默认采用了动态补全的方法,按照batch进行补全,能够节省计算资源。

在我的CPU上跑,时间从36小时变为2小时(没跑完,进度条给的预估时间)

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