From 50bf758ef09e9cea3f537de0d5ae007fd4683d17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6pf?= Date: Wed, 3 May 2023 16:20:48 +0200 Subject: [PATCH] Remove auth_token from args stored in sampling reports (#3024) HF auth-tokens leaked into sampling reports a couple of times. This PR explicitly removes the auth_token from the args written into the sampling report. --- model/model_eval/manual/sampling_report.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/model/model_eval/manual/sampling_report.py b/model/model_eval/manual/sampling_report.py index 5a95674c6b..4d96585bd8 100644 --- a/model/model_eval/manual/sampling_report.py +++ b/model/model_eval/manual/sampling_report.py @@ -316,10 +316,13 @@ def main(): if args.n: prompts = prompts[: args.n] + args_dict = vars(args) + if "auth_token" in args_dict: + del args_dict["auth_token"] report = SamplingReport( model_name=model_name, date=datetime.utcnow().isoformat(), - args=vars(args), + args=args_dict, prompts=sample_prompt_continuations( prompts=prompts, model=model,