Skip to content
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

Typo/nit fixes and add tests for BoostrapWithRandomSearch #1502

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

chenmoneygithub
Copy link
Collaborator

Fix a few odds in the BootstrapFewShotWithRandomSearch optimizer:

  • Zombie code should be deleted.
  • f-string for print/logging.
  • variable names like program2 are confusing.

Also added basic unit test case for BootstrapFewShotWithRandomSearch.

Copy link
Collaborator

@arnavsinghvi11 arnavsinghvi11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chenmoneygithub , let's leave the commented code / variable names as-is for now as we make decisions on how to integrate this going forward.

The test for RandomSearch is a bit trivial - I would recommend following how the test is setup for BootstrapFewShot here and adding the validations of multiple optimization program candidates in this test. Let me know if that makes sense

@@ -48,16 +48,10 @@ def __init__(
self.max_num_samples = max_bootstrapped_demos
self.max_errors = max_errors
self.num_candidate_sets = num_candidate_programs
# self.max_num_traces = 1 + int(max_bootstrapped_demos / 2.0 * self.num_candidate_sets)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment back in


scores.append(score)
print(f"Scores so far: {scores}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment back in

@chenmoneygithub
Copy link
Collaborator Author

chenmoneygithub commented Sep 18, 2024

@arnavsinghvi11 For a public repo with big user base, there shouldn't be any zombie code. Three reasons:

  • Most likely commented code won't be revived in its lifetime.
  • Commented code becomes invalid after a short while because it's not executed.
  • Only a few people have the context, for other people it's not meaningful.

if something is worth further discussion opening an issue for tracking is a better approach.

Re the unit test - the goal of this PR is lint fix, and the test is for sanity check. I am not sure what's the best way to test it out without making actual LLM calls, will work on that in a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants