Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

bench: annotate the fixed Hugging Face shard URL for semgrep

garrytan08f92cb301d4
diff --git a/scripts/bench/hnsw-real-corpus-prep.py b/scripts/bench/hnsw-real-corpus-prep.py
index b3b9418c31..94997fac91 100644
--- a/scripts/bench/hnsw-real-corpus-prep.py
+++ b/scripts/bench/hnsw-real-corpus-prep.py
@@ -61,6 +61,7 @@ def main():
for shard in range(41):
path = os.path.join(args.out, f'shard-{shard:05d}.parquet')
if not os.path.exists(path):
+ # nosemgrep: python.lang.security.audit.dynamic-urllib-use-detected.dynamic-urllib-use-detected -- the URL is the fixed https Hugging Face BASE with an integer shard number; no caller input reaches it
urllib.request.urlretrieve(BASE.format(shard), path + '.part')
os.rename(path + '.part', path)
table = pq.read_table(path, columns=['id', 'text'])