-
Notifications
You must be signed in to change notification settings - Fork 2.6k
CI refactor; allow setting args in config #2893
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
base: main
Are you sure you want to change the base?
CI refactor; allow setting args in config #2893
Conversation
use case: or one can explicitly state: ``CUDA_VISIBLE_DEVICES=0 lm_eval --config configs/default_config.yaml |
This is a really good idea. I haven't looked at the implementation itself but I think that this functionality is going to be hugely valuable. I also strongly agree with the choice to allow both CLI arguments and yaml arguments and having the CLI take precidence over the yaml arguments. |
@baberabb @StellaAthena i think this would be a great feature for all users - to keep configs in a dir and no need in writing the flags in terminal |
Hi @artemorloff!. This is generally great, especially as the number of arguments which need to pass keep in increasing. One thing: have you considered using a dataclass? Something like: @dataclass
class EvalConfig:
model: str = "hf"
tasks: Optional[str] = None
...
@classmethod
def from_yaml(cls, path):
# load and convert yaml
@classmethod
def from_args(cls, args, yaml_path=None):
... Think this would make the code easier to read, and more maintainable. Happy to sketch it out more if you think it's helpful. |
@baberabb seems a good idea. will prepare the draft |
@baberabb added prototype of Eval config class that is used to unify evaluation. Based on BaseModel so that it may later be reworked the way that params are validated and updated inside config class, not inside main.py funcs |
Hi @artemorloff! tysm for working on this. I'll take a closer look this week, but feel free to ping me in case I don't respond by Friday. Couple of initial points (mostly backward compatibility):
|
Hi @artemorloff! thanks again for working on this, and sorry for the late review. The logic overall looks pretty great, but made some slight changes:
Let me know what you think! |
# Conflicts: # lm_eval/__main__.py
might be much more convenient to pass path to config file to run evaluation via
lm-eval
PR allows a user to pass
--config PATH_TO_YAML_FILE
arg that contains the same args as the console evaluation script. With recent updates there are too much args to track them on console. It may be easier to write one yaml file (provide example in configs/ dir) and pass it into the script.Also PR allows to override this config. If user provides
--config PATH
param along with other params, they prevail over the same params in config. So, user may define all params in yaml file and change only those that they need right now, others remain as they are in yaml file. To grant that all params from console will be treated with "high priority" addedaction
to each param that just adds arg indicating that some param was explicitly stated by the user from console. Those params won't be changed by config file.Also config is parsed right after reading to avoid using
simple_parse_args_string
and make the code more unified and simplified.