Skip to content

Commit

Permalink
Remove auth_token from args stored in sampling reports (LAION-AI#3024)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andreaskoepf authored and root committed May 11, 2023
1 parent df02a6a commit 50bf758
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion model/model_eval/manual/sampling_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 50bf758

Please sign in to comment.