8000 Added how to use commit0 for sampling during STAR training by wenting-zhao · Pull Request #105 · commit-0/commit0 · GitHub
[go: up one dir, main page]

Skip to content

Added how to use commit0 for sampling during STAR training #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use subprocess timeout to handle modal failures
  • Loading branch information
wenting-zhao committed Dec 16, 2024
commit 7576839df79e3e2d8244dcd2b2bd4bedf7749272
3 changes: 2 additions & 1 deletion examples/star/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ python examples/star/star.py \
--iteration 5 \
--learning_rate 1e-6 \
--per_device_train_batch_size 1 \
--gradient_accumulation_steps 8
--gradient_accumulation_steps 8 \
--max_workers 64

11 changes: 8 additions & 3 deletions examples/star/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def execute_tests(
input=sample,
text=True,
capture_output=True,
timeout=30,
): (i, j)
for (i, j, instance_id, sample) in tasks
}
Expand All @@ -72,9 +73,13 @@ def execute_tests(
as_completed(futures), total=len(tasks), desc="Executing tests"
):
i, j = futures[future]
result = future.result()
stdout = result.stdout
exit_code = result.returncode
try:
result = future.result()
stdout = result.stdout
exit_code = result.returncode
except subprocess.TimeoutExpired:
stdout = "Timeout"
exit_code = -1
all_traces[i][j] = stdout
all_execution_results[i][j] = exit_code

Expand Down
Loading
0