From 52c2f5794dcca9a144fed0f09e95cb42d4baaae6 Mon Sep 17 00:00:00 2001 From: MikeRoz47 <31170177+MikeRoz47@users.noreply.github.com> Date: Sun, 15 Feb 2026 16:41:18 +0000 Subject: [PATCH] Add optional arg to compare_q to allow it to save plots rather than show them --- eval/compare_q.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eval/compare_q.py b/eval/compare_q.py index 848ad49..ad85ce0 100644 --- a/eval/compare_q.py +++ b/eval/compare_q.py @@ -317,7 +317,10 @@ def plot(results, args): plt.grid(color = 'dimgray', linestyle = '--', linewidth = 0.5) else: plt.grid(True) - plt.show() + if args.plot_file: + plt.savefig(args.plot_file) + else: + plt.show() def dict_hash(x: dict) -> str: @@ -403,6 +406,7 @@ if __name__ == "__main__": parser.add_argument("-mask", "--mask", type = str, help = "Semicolon-separated list of strings to match against model labels for inclusion") parser.add_argument("-lf", "--logits_file", type = str, help = "Reference logits file for KLD", required = False) parser.add_argument("-dark", "--dark", action = "store_true", help = "Dark mode") + parser.add_argument("-pf", "--plot_file", type = str, help = "Write the plot to a file") _args = parser.parse_args() main(_args)