-
Notifications
You must be signed in to change notification settings - Fork 368
launch lighteval using lighteval --args
#152
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
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
29e5cb8
init
a35305a
add nanotron to lighteval cli
54486ae
make style
d59dd2c
Merge remote-tracking branch 'origin/main' into nathan-add-cli-tool
70cc52c
Merge remote-tracking branch 'origin/main' into nathan-add-cli-tool
NathanHB 819d27e
working with accelerate
NathanHB 16fe94e
fix tests
NathanHB 5db6049
fix style
NathanHB a128176
add files
NathanHB add6e6f
small fixes
NathanHB 2d15999
undo
NathanHB ddbb748
working
ecf98d2
uppdate doc
46c5ab2
fix tests
NathanHB bcf834c
fix style
NathanHB d6f6092
fix
NathanHB 40df0c2
fix nanotron launcher
NathanHB 5c09917
Revert "fix nanotron launcher"
NathanHB fa82b13
fix nanotron launcher
NathanHB 604684e
Merge branch 'main' into nathan-add-cli-tool
NathanHB 1d1d2ab
Merge branch 'main' into nathan-add-cli-tool
NathanHB bff354e
Merge branch 'main' into nathan-add-cli-tool
NathanHB ebb5611
fixes after merge
NathanHB 035aab7
Merge branch 'main' into nathan-add-cli-tool
clefourrier 3e077d5
Merge branch 'main' into nathan-add-cli-tool
clefourrier 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,65 @@ | ||
| #!/usr/bin/env python | ||
|
|
||
| # MIT License | ||
|
|
||
| # Copyright (c) 2024 Taratra D. RAHARISON and The HuggingFace Team | ||
|
|
||
| # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| # of this software and associated documentation files (the "Software"), to deal | ||
| # in the Software without restriction, including without limitation the rights | ||
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| # copies of the Software, and to permit persons to whom the Software is | ||
| # furnished to do so, subject to the following conditions: | ||
|
|
||
| # The above copyright notice and this permission notice shall be included in all | ||
| # copies or substantial portions of the Software. | ||
|
|
||
| # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| # SOFTWARE. | ||
|
|
||
| import argparse | ||
|
|
||
| from lighteval.parsers import parser_accelerate, parser_nanotron | ||
| from lighteval.tasks.registry import Registry | ||
|
|
||
|
|
||
| def cli_evaluate(): | ||
| parser = argparse.ArgumentParser(description="CLI tool for lighteval, a lightweight framework for LLM evaluation") | ||
| subparsers = parser.add_subparsers(help="help for subcommand", dest="subcommand") | ||
|
|
||
| # create the parser for the "accelerate" command | ||
| parser_a = subparsers.add_parser("accelerate", help="use accelerate and transformers as backend for evaluation.") | ||
| parser_accelerate(parser_a) | ||
|
|
||
| # create the parser for the "nanotron" command | ||
| parser_b = subparsers.add_parser("nanotron", help="use nanotron as backend for evaluation.") | ||
| parser_nanotron(parser_b) | ||
|
|
||
| parser.add_argument("--list-tasks", action="store_true", help="List available tasks") | ||
|
|
||
| args = parser.parse_args() | ||
|
|
||
| if args.subcommand == "accelerate": | ||
NathanHB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| from lighteval.main_accelerate import main as main_accelerate | ||
|
|
||
| main_accelerate(args) | ||
| return | ||
|
|
||
| if args.subcommand == "nanotron": | ||
| from lighteval.main_nanotron import main as main_nanotron | ||
|
|
||
| main_nanotron(args.checkpoint_config_path, args.lighteval_override, args.cache_dir) | ||
| return | ||
|
|
||
| if args.list_tasks: | ||
| Registry(cache_dir="").print_all_tasks() | ||
| return | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| cli_evaluate() | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not fond of
accelerate ... lighteval accelerateThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree but not sure how we could really differenciate between nanotron and accelerate launchers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, can you launch nanotron with accelerate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdym ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we'll ever get
accelerate launch ... lighteval nanotronThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we could assume that if
accelerate launchis used, then it's lighteval accelerate?