Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add adapter support for X-MOD model #581

Merged
merged 4 commits into from
Sep 5, 2023

Conversation

calpt
Copy link
Member

@calpt calpt commented Aug 28, 2023

Integrates adapter support into HuggingFace's X-MOD implementation.

Implementation notes

HF model already supports adapters integrated into X-MOD. Several changes were necessary to make HF's implementation compatible with Adapters:

  • deactivate HF's custom adapter logic: lang_ids parameter and set_default_language() are deactivated in favor of regular adapter methods. Documented in model class docs.
  • conversion of adapter checkpoints: utils/convert_xmod_checkpoint.py Only converted checkpoints can be used with Adapters. We'll convert & re-upload some of the original X-MOD checkpoints to the Hub.

Tasks

  • basic model implementation
  • tests
  • documentation
  • convert weights from HF checkpoints
  • upload converted checkpoints

Xmod class conversion

Fix issues after refactoring

Xmod docs & adapter-specific logic

Checkpoint conversion.

minor modifications
@calpt calpt marked this pull request as ready for review August 30, 2023 11:56
Copy link
Member

@hSterz hSterz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good just some minor comments

src/adapters/models/xmod/mixin_xmod.py Show resolved Hide resolved
src/adapters/models/xmod/modeling_xmod.py Show resolved Hide resolved
src/adapters/models/xmod/modeling_xmod.py Outdated Show resolved Hide resolved
docs/classes/models/xmod.rst Outdated Show resolved Hide resolved
Copy link
Member

@hSterz hSterz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@calpt calpt merged commit 57805f5 into adapter-hub:adapters Sep 5, 2023
4 checks passed
@calpt calpt deleted the dev/adapters/xmod branch September 5, 2023 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants