Skip to content
Snippets Groups Projects
Commit 11bd357f authored by Max Kimmich's avatar Max Kimmich
Browse files

Log cli arguments and some more infos

parent 26c64b3e
No related branches found
No related tags found
No related merge requests found
......@@ -281,6 +281,12 @@ def run_episode(evo_alg_str: str, debug: bool = False):
if __name__ == "__main__":
options = argument_parser.parse_args()
# log cli arguments
logger.info(
"CLI arguments:\n\tPositional:%s\n\tKeyword:\n\t\t%s",
", ".join(options._get_args()),
"\n\t\t".join((f"{param}={value}" for param, value in options._get_kwargs())),
)
# debug mode will allow for a quick run
debug = options.debug
......@@ -317,6 +323,7 @@ if __name__ == "__main__":
match options.task:
case "sa":
logger.info("Running with task sentiment analysis on dataset SetFit/sst2")
task = SentimentAnalysis(
evaluation_model,
"SetFit/sst2",
......@@ -325,6 +332,7 @@ if __name__ == "__main__":
test_split="test[:20]" if debug else "test",
)
case "qa":
logger.info("Running with task question answering on dataset squad")
task = QuestionAnswering(
evaluation_model,
"squad",
......@@ -337,4 +345,6 @@ if __name__ == "__main__":
f"Task {options.task} does not exist. Choose from 'sa', 'qa'."
)
logger.info("Using evolutionary algorithm '%s'", options.evolution_algorithm)
run_episode(evo_alg_str=options.evolution_algorithm, debug=debug)
......@@ -162,7 +162,7 @@ def save_family_tree_visualization(family_tree, P, metric_name: str):
prompt=fill(str(prompt)),
prompt_generations=", ".join(prompt_generations(prompt)),
score=prompt.score,
metric_name=metric_name
metric_name=metric_name,
)
dot.node(
f"{node_id(prompt)}",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment