Closed awni closed 3 weeks ago
I have some questions that you may or may not have opinions on. Mostly for a follow up PR:
make_sampler
and make_logits_processor
outside of generate_step
so that one can pass in any sampler / logit processor to that function. Thoughts?stream_generate
and generate
: yes I want to. generate
could easily be a convenience wrapper around stream_generate
which does the optional formatting and verbose logging.stream_generate
to simplify needing to do this in multiple places (it's also easy to do incorrectly) which returns a richer output (maybe a data class with all the fields). I don't want to overcomplicate it.. but that might make it easier to use.At any rate.. I'll probably put together a PR for some of that soon and we can discuss more concretely. But that's kind of where this is heading in case you have early thoughts on it.
This is part 1 of a potential second part diff to refactor samplers and logits processors outside of the
generate_step
function. The idea being that function is getting too fat.. and it will also be much more flexible to experiment with alternative samplers / logits processors without hackinggenerate_step
.To start this diff:
stream_generate
is more flexible: returns logits and token as well as text and accepts pre-tokenized inputsstream_generate
stream_generate
in the server instead ofgenerate_step