Skip to content

Commit

Permalink
Merge pull request #122 from sbwilli3/patch-1
Browse files Browse the repository at this point in the history
benchmarking - update check_content for byte support
  • Loading branch information
Boyan-MILANOV authored Oct 21, 2024
2 parents a702d58 + 5b9b696 commit 18d4b93
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pickle_scanning_benchmark/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ def hf_download_pickle_files(

def _check_content(content):
# Typical access error from HF API
if content.startswith("Access to model"):
raise Exception("Can not access model file")
if isinstance(content, bytes):
if content.startswith(b"Access to model"):
raise Exception("Can not access model file")
else:
if content.startswith("Access to model"):
raise Exception("Can not access model file")


def _download_pickle_file(url, file, outdir):
Expand Down

0 comments on commit 18d4b93

Please sign in to comment.