Fix MultinomialSampler hyperparameter bug
Currently seems like the MultinomialSampler does not utilize all logit_processors, only the last one in self.logit_processors. Thus, some of the hyperparameters (i.e. top_k) are not utilized. This fixes this issue with a small variable change.
I initialized a sampler and passed it into a regex generator.
sampler = outlines.samplers.MultinomialSampler(temperature=1.5, top_k=100, samples=5)
generator = outlines.generate.regex(
model,
r"I really love (\S*) cake with ice cream.",
sampler=sampler
)
structured = generator(prompt, max_tokens=30)
First generate.api.SequenceGenerator.__call__ is called
which calls generate.generator.sequence_generator
which calls sampler.__call__
I assume this was with ExLlamaV2, or am I wrong? Good find.
I'm not sure about ExLlamaV2, but maybe? This was my model initialization code model = outlines.models.transformers("meta-llama/Meta-Llama-3-8B")