Skip to content

Commit

Permalink
Neuronpedia: allow resuming upload (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
hijohnnylin authored Apr 25, 2024
1 parent bbb6a05 commit 0184671
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tutorials/neuronpedia/neuronpedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,26 @@ def upload(
prompt="""Host to upload to? (Default: http://localhost:3000)""",
),
] = "http://localhost:3000",
resume: Annotated[
int,
typer.Option(
prompt="""Resume from batch? (Default: 1)""",
),
] = 1,
):
"""
This will upload features that were generated to Neuronpedia. It currently only works if you have admin access to a Neuronpedia instance via localhost:3000.
"""

files_to_upload = list(outputs_dir.glob("batch-*.json"))

# filter files where batch-[number].json the number is >= resume
files_to_upload = [
file_path
for file_path in files_to_upload
if int(file_path.stem.split("-")[1]) >= resume
]

# sort files by batch number
files_to_upload.sort(key=lambda x: int(x.stem.split("-")[1]))

Expand Down

0 comments on commit 0184671

Please sign in to comment.