Skip to content

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

Merged
leondz merged 3 commits into
mainfrom
feature/generation_count
Apr 24, 2024
Merged

allow generators.Base.generate() to take an optional param specifying generation count#600
leondz merged 3 commits into
mainfrom
feature/generation_count

Conversation

@leondz

@leondz leondz commented Apr 11, 2024

Copy link
Copy Markdown
Collaborator

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

leondz commented Apr 11, 2024

Copy link
Copy Markdown
Collaborator Author

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 architecture Architectural upgrades generators Interfaces with LLMs labels Apr 11, 2024
Comment thread garak/generators/base.py
Comment thread garak/generators/base.py

@erickgalinkin erickgalinkin left a comment

Copy link
Copy Markdown
Collaborator

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
@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

architecture 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