VESSL provides integrations for 🤗 Transformers by HuggingFace in form of TrainerCallback.

VesslCallback

VesslCallback extends TrainerCallback in Transformers, which can define the behaviors of Trainer during the training. Add VesslCallback to callback parameter of Trainer class, so that the metrics logged by trainer are tracked by VESSL as well. You can add instantiated VesslCallback to use another organization and project.

ParameterDescription
access_tokenAccess token to override.
organization_nameOrganization name to override.
project_nameProject name to override.
credentials_fileCredential file to access the organization and the project
force_update_access_tokenTrue if force update access token

Logging metrics

from vessl.integration.transformers import VesslCallback

...
# Add callback class itself, so that the default organization and project are used
trainer = Trainer(
    ...
    callbacks=[VesslCallback]
)

# ... or you can specify the configuration you want
callback = VesslCallback(
    access_token=YOUR_ACCESS_TOKEN,
    organization_name="your_organization",
    project_name = "your_project",
)
trainer = Trainer(
    ...,
    callbacks=[callback]
)
trainer.train()
...