-
Notifications
You must be signed in to change notification settings - Fork 109
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
Homogeneize generation params #428
Open
clefourrier
wants to merge
31
commits into
main
Choose a base branch
from
clem_homogeneize_generation_params
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
1ff5a78
adding input generation config
clefourrier 12c6a90
added tgi model
clefourrier c9657d2
grammar is task dependant, removed from the cofnig
clefourrier ac6565a
added openai config + moved everything to dict
clefourrier 2628571
added generation configs to models
clefourrier c24bf9b
added generation configs to models
clefourrier 0aa2e19
fix
clefourrier e3311bd
fix
clefourrier a3f535f
added doc
clefourrier 286668f
Saved GenerationParameter class in model config classes, then saved i…
clefourrier 0b2475a
changed model args
clefourrier 521559f
test
clefourrier 91363fe
Merge branch 'main' into clem_homogeneize_generation_params
clefourrier c088ab6
updated launchers
clefourrier e1bd34f
Merge branch 'main' into clem_homogeneize_generation_params
clefourrier 3eb7d0f
rename base_model to transformers_model
clefourrier a585701
removed the use of a GenerationConfig object, as it's got lots of par…
clefourrier f9ab29b
revert
clefourrier 4833929
fix docs
clefourrier 30bed89
fix #16 by also allowing a generationconfig object to be passed progr…
clefourrier 431b4f2
Merge branch 'main' into clem_homogeneize_generation_params
clefourrier fb4ecdc
Apply suggestions from code review
clefourrier be99c5e
Update src/lighteval/models/transformers/transformers_model.py
clefourrier e8b9057
Merge branch 'main' into clem_homogeneize_generation_params
clefourrier dece2f9
removed temperature from default vllm params as it should be passed v…
clefourrier 8e3b7e2
Merge branch 'main' into clem_homogeneize_generation_params
clefourrier 5c89fe2
Update src/lighteval/models/transformers/transformers_model.py
clefourrier 6a18b81
logging fix
clefourrier 83cbb10
Merge branch 'main' into clem_homogeneize_generation_params
clefourrier c6f42ca
Merge branch 'main' into clem_homogeneize_generation_params
clefourrier 90593a9
added default gen params
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 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 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 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 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 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 |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
from typing import Optional | ||
|
||
import typer | ||
import yaml | ||
from typer import Argument, Option | ||
from typing_extensions import Annotated | ||
|
||
|
@@ -42,8 +43,11 @@ | |
@app.command(rich_help_panel="Evaluation Backends") | ||
def openai( | ||
# === general === | ||
model_name: Annotated[ | ||
str, Argument(help="The model name to evaluate (has to be available through the openai API.") | ||
model_args: Annotated[ | ||
str, | ||
Argument( | ||
help="Model name as a string (has to be available through the openai API) or path to yaml config file (see examples/model_configs/transformers_model.yaml)" | ||
), | ||
], | ||
tasks: Annotated[str, Argument(help="Comma-separated list of tasks to evaluate on.")], | ||
# === Common parameters === | ||
|
@@ -94,8 +98,17 @@ def openai( | |
""" | ||
from lighteval.logging.evaluation_tracker import EvaluationTracker | ||
from lighteval.models.endpoints.openai_model import OpenAIModelConfig | ||
from lighteval.models.model_input import GenerationParameters | ||
from lighteval.pipeline import EnvConfig, ParallelismManager, Pipeline, PipelineParameters | ||
|
||
if model_args.endswith(".yaml"): | ||
with open(model_args, "r") as f: | ||
config = yaml.safe_load(f)["model"] | ||
generation_parameters = GenerationParameters.from_dict(config) | ||
Comment on lines
+105
to
+107
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe worth adding a |
||
model_config = OpenAIModelConfig(model=config["model_name"], generation_parameters=generation_parameters) | ||
else: | ||
model_config = OpenAIModelConfig(model=model_args) | ||
|
||
env_config = EnvConfig(token=TOKEN, cache_dir=cache_dir) | ||
evaluation_tracker = EvaluationTracker( | ||
output_dir=output_dir, | ||
|
@@ -107,7 +120,6 @@ def openai( | |
) | ||
|
||
parallelism_manager = ParallelismManager.OPENAI | ||
model_config = OpenAIModelConfig(model=model_name) | ||
|
||
pipeline_params = PipelineParameters( | ||
launcher_type=parallelism_manager, | ||
|
@@ -205,7 +217,6 @@ def inference_endpoint( | |
""" | ||
Evaluate models using inference-endpoints as backend. | ||
""" | ||
|
||
from lighteval.logging.evaluation_tracker import EvaluationTracker | ||
from lighteval.models.endpoints.endpoint_model import InferenceEndpointModelConfig, ServerlessEndpointModelConfig | ||
from lighteval.pipeline import EnvConfig, ParallelismManager, Pipeline, PipelineParameters | ||
|
@@ -319,7 +330,6 @@ def tgi( | |
""" | ||
Evaluate models using TGI as backend. | ||
""" | ||
|
||
from lighteval.logging.evaluation_tracker import EvaluationTracker | ||
from lighteval.models.endpoints.tgi_model import TGIModelConfig | ||
from lighteval.pipeline import EnvConfig, ParallelismManager, Pipeline, PipelineParameters | ||
|
This file contains 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 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 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
Oops, something went wrong.
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.
Need to rename the file
to