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 functions for input-masked loss calculation and batching #825

Closed
wants to merge 19 commits into from

Conversation

chimezie
Copy link
Contributor

@chimezie chimezie commented Jun 7, 2024

Adds support for completion-only finetuning via functions for iterating over batching that also calculates input masks and a loss function using the masks and updates in (D/L)oRA tuner to use it w/ --mask-inputs (addressing/adding: #484, see: #1086)

-- Updated to keep up with mlx(_lm) changes, etc.

llms/mlx_lm/tuner/trainer.py Outdated Show resolved Hide resolved
llms/mlx_lm/tuner/trainer.py Outdated Show resolved Hide resolved
@chimezie chimezie changed the title Add functions for input-masked loss calculation and padded batching Add functions for input-masked loss calculation and batching Nov 5, 2024
chimezie added a commit to chimezie/lm-evaluation-harness-mlx that referenced this pull request Nov 10, 2024
Simplify by removing unnecessary imports and the unused chat templating method. Adjust tokens and batch handling to properly manage sequence lengths and masking using latest, related mlx_lm bits (ml-explore/mlx-examples#825).
@chimezie
Copy link
Contributor Author

Superseded by #1103

@chimezie chimezie closed this Nov 13, 2024
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