Skip to content

Commit

Permalink
Fix resuming from batch
Browse files Browse the repository at this point in the history
  • Loading branch information
hijohnnylin committed Apr 18, 2024
1 parent 1a7d636 commit 145a407
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tutorials/neuronpedia/neuronpedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def generate(
outputs_dir.mkdir(parents=True, exist_ok=True)
# Check if output_dir has any files starting with "batch_"
batch_files = list(outputs_dir.glob("batch-*.json"))
if len(batch_files) > 0 and resume_from_batch != 1:
if len(batch_files) > 0 and resume_from_batch == 1:
print(
f"Error: Output directory {outputs_dir.as_posix()} has existing batch files. This is only allowed if you are resuming from a batch. Please delete or move the existing batch-*.json files."
)
Expand Down Expand Up @@ -230,7 +230,7 @@ def generate(
)

# iterate from 1 to num_batches
for i in range(1, num_batches + 1):
for i in range(resume_from_batch, num_batches + 1):
command = [
"python",
"make_batch.py",
Expand Down

0 comments on commit 145a407

Please sign in to comment.