8000 Add a way for `callbacks` to get `trainer` handler · Issue #38181 · huggingface/transformers · GitHub
[go: up one dir, main page]

Skip to content
Add a way for callbacks to get trainer handler #38181
@MinzhiYoyo

Description

@MinzhiYoyo

When I want to implement differential privacy for the model, I customize the gradient clipping before optimizer.step(). The add custom noise to the model after optimizer.step(). I cannot get Trainer.optimizer in the callback function, it shows as None. Is it possible to get the reference of Trainer directly in callback?

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

      0