-
Notifications
You must be signed in to change notification settings - Fork 349
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
Generator streamlining, docs #682
Conversation
…nerate() return would/would not be filtered for None that was predicated on whether a model supported multiple outputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
My question may already be answered somewhere, it does not change that current expectations are as documented.
#. Otherwise, we need to assemble the outputs over multiple calls. There are two options here. | ||
#. Is garak running with ``parallel_attempts > 1`` configured? In that case, start a multiprocessing pool with as many workers as the value of ``parallel_attempts``, and have each one of these work on building the required number of generations, in any order. | ||
#. Otherwise, call ``_call_model()`` repeatedly to collect the requested number of generations. | ||
#. Strip ``None`` responses from the outputs, and return the resulting list of prompt responses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the current practice, however I am interested in the reasoning for this. Is there value in knowing that call returned None
, in theory we can determine this happened from inspection of configuration, however I wonder if a None
response might be valuable in some probes patterns. Consider if a model is setup to mitigate certain responses by simply closing the connection. In practice this is not a good
pattern as a 200
response with a rejection is the common response, yet I can akin it to the idea that if you call someone to ask a question they might simply hang up the phone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a great time to ask this question. None
is intended to indicate that generation failed, so would definitely be good for the situation you mention. Perhaps then generate()
should not filter out None
s at all. But also - perhaps when a model fails when given a blank prompt, it should return None
, instead of exception handling and a string. I think that we're in a better place if any str
-typed output from a generator is an indication that the model successfully output a string, and that this output is the string component of the output. Wdyt?
cf.: #689 (comment)
Added generator docs
Made streamlining changes to
generators.base.Generator
logicResolves #662