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

allow generators.Base.generate() to take an optional param specifying generation count #600

Merged
merged 3 commits into from
Apr 24, 2024

Conversation

leondz
Copy link
Owner

@leondz leondz commented Apr 11, 2024

Also required clearing up some type signatures and amending _call_model a bunch of places

Would rather _call_model didn't have to take an extra param, but sometimes it cares about the number of generations. Because generator objects handle parallel requests, they're not a great place to handle state - each generation request should be atomic and self-contained

Leaving in _call_model's generations_this_call param makes for a weird situation where one might think _call_model can be invokes asking for many generations, where in fact this may be ignored (undef behaviour)

@leondz leondz linked an issue Apr 11, 2024 that may be closed by this pull request
@leondz
Copy link
Owner Author

leondz commented Apr 11, 2024

oh hey we should be checking if models generate the number of responses we want, and define & test what happens when they don't. cool cool cool (#601 )

@leondz leondz added enhancement Architectural upgrades generators Interfaces with LLMs labels Apr 11, 2024
garak/generators/base.py Show resolved Hide resolved
garak/generators/base.py Show resolved Hide resolved
Copy link
Collaborator

@erickgalinkin erickgalinkin left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Signed-off-by: Leon Derczynski <leonderczynski@gmail.com>
@leondz leondz merged commit a36e276 into main Apr 24, 2024
9 checks passed
@leondz leondz deleted the feature/generation_count branch April 24, 2024 08:25
@github-actions github-actions bot locked and limited conversation to collaborators Apr 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Architectural upgrades generators Interfaces with LLMs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allow overriding generation count in Generator.generate()
2 participants