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

[MIPRO_v2] error in bootstrapping few-shot examples raises TypeError #1580

Closed
mikeedjones opened this issue Oct 3, 2024 · 2 comments · Fixed by #1581
Closed

[MIPRO_v2] error in bootstrapping few-shot examples raises TypeError #1580

mikeedjones opened this issue Oct 3, 2024 · 2 comments · Fixed by #1581
Assignees

Comments

@mikeedjones
Copy link
Contributor

mikeedjones commented Oct 3, 2024

Any error raised whilst generating bootstrap examples is handled and sets demo_candidates = None

255            except Exception as e:
256                print(f"Error generating fewshot examples: {e}")
257                print("Running without fewshot examples.")
258                demo_candidates = None

which causes a type error with grounded_proposer.

    305 # Create an instruction for each predictor 
    306 for pred_i, predictor in enumerate(program.predictors()):
--> 307     for demo_set_i in range(len(demo_candidates[0])):
    308         if pred_i not in proposed_instructions:
    309             proposed_instructions[pred_i] = []

TypeError: 'NoneType' object is not subscriptable

Not sure if this should be fixed by either:

  • Raising an exception if there is an error during bootstrapping
  • Setting demo_candidates={} in MIPRO_v2
  • Accounting for demo_candidates is None in proposer.propose_instructions_for_program

Or something else :)

@okhat
Copy link
Collaborator

okhat commented Oct 3, 2024

@XenonMolecule Can you investigate?

@XenonMolecule
Copy link
Collaborator

@mikeedjones can you see if #1581 works for you? I tested on a few internal programs by simulating an exception during bootstrapping, but I would love to know if this fixes your real test case.

@okhat okhat reopened this Oct 3, 2024
@okhat okhat closed this as completed Oct 4, 2024
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 a pull request may close this issue.

3 participants