Skip to content

Instantly share code, notes, and snippets.

View hogru's full-sized avatar

Stephan Holzgruber hogru

View GitHub Profile
@BramVanroy
BramVanroy / run.py
Last active July 19, 2023 09:22
Overwrite HfArgumentParser config options with CLI arguments
# See https://gist.github.com/BramVanroy/f78530673b1437ed0d6be7c61cdbdd7c
parser = HfArgumentParser((ModelArguments, DataTrainingArguments, TrainingArguments, HyperOptArguments))
try:
# Assumes that the first .json file is the config file (if any)
config_file = next(iter(arg for arg in sys.argv if arg.endswith(".json")))
except StopIteration:
config_file = None
run_name_specified = False