-
Notifications
You must be signed in to change notification settings - Fork 1k
adding report-to-wandb #9
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
Merged
awni
merged 25 commits into
ml-explore:main
from
Goekdeniz-Guelmez:adding-report-to-wandb
May 10, 2025
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
25b8dd7
update lora_config.yaml + LORA.md + lora.py
Goekdeniz-Guelmez d723843
Merge branch 'ml-explore:main' into adding-report-to-wandb
Goekdeniz-Guelmez cb7f8a3
Merge branch 'ml-explore:main' into adding-report-to-wandb
Goekdeniz-Guelmez abbbdca
code formatting
Goekdeniz-Guelmez 32e834f
Merge branch 'ml-explore:main' into adding-report-to-wandb
Goekdeniz-Guelmez db9e156
Merge branch 'ml-explore:main' into adding-report-to-wandb
Goekdeniz-Guelmez 94a226e
Merge branch 'ml-explore:main' into adding-report-to-wandb
Goekdeniz-Guelmez c39532f
udpaet Acknowledgements.md
Goekdeniz-Guelmez a0bbe11
nits
Goekdeniz-Guelmez becbaec
Merge branch 'ml-explore:main' into adding-report-to-wandb
Goekdeniz-Guelmez 0304b28
Refactor WandB integration in lora.py and trainer.py
Goekdeniz-Guelmez a3a6d49
Enhance WandBCallback to include log directory in initialization
Goekdeniz-Guelmez e710205
nits
Goekdeniz-Guelmez 1db8c28
formating
Goekdeniz-Guelmez 4513137
Merge branch 'ml-explore:main' into adding-report-to-wandb
Goekdeniz-Guelmez 6d77293
Merge branch 'main' into adding-report-to-wandb
Goekdeniz-Guelmez 142f316
Merge branch 'ml-explore:main' into adding-report-to-wandb
Goekdeniz-Guelmez 4439694
Merge branch 'main' into adding-report-to-wandb
Goekdeniz-Guelmez 40682c4
Merge branch 'main' into adding-report-to-wandb
Goekdeniz-Guelmez c4e62db
Merge branch 'ml-explore:main' into adding-report-to-wandb
Goekdeniz-Guelmez 7fd78fd
README.md
Goekdeniz-Guelmez 35d9d68
update example yaml
Goekdeniz-Guelmez e5ed455
nits
Goekdeniz-Guelmez 325df0e
nits
Goekdeniz-Guelmez 50f5381
nits in readme
awni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| try: | ||
| import wandb | ||
| except ImportError: | ||
| wandb = None | ||
|
|
||
|
|
||
| class TrainingCallback: | ||
|
|
||
| def on_train_loss_report(self, train_info: dict): | ||
| """Called to report training loss at specified intervals.""" | ||
| pass | ||
|
|
||
| def on_val_loss_report(self, val_info: dict): | ||
| """Called to report validation loss at specified intervals or the beginning.""" | ||
| pass | ||
|
|
||
|
|
||
| class WandBCallback(TrainingCallback): | ||
| def __init__( | ||
| self, | ||
| project_name: str, | ||
| log_dir: str, | ||
| config: dict, | ||
| wrapped_callback: TrainingCallback = None, | ||
| ): | ||
| if wandb is None: | ||
| raise ImportError( | ||
| "wandb is not installed. Please install it to use WandBCallback." | ||
| ) | ||
| self.wrapped_callback = wrapped_callback | ||
| wandb.init(project=project_name, dir=log_dir, config=config) | ||
|
|
||
| def on_train_loss_report(self, train_info: dict): | ||
| wandb.log(train_info) | ||
| if self.wrapped_callback: | ||
| self.wrapped_callback.on_train_loss_report(train_info) | ||
|
|
||
| def on_val_loss_report(self, val_info: dict): | ||
| wandb.log(val_info) | ||
| if self.wrapped_callback: | ||
| self.wrapped_callback.on_val_loss_report(val_info) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.