mlx-examples icon indicating copy to clipboard operation
mlx-examples copied to clipboard

Return logprobs from generate api

Open farris opened this issue 1 year ago • 1 comments

Continuation of https://github.com/ml-explore/mlx-examples/issues/894#issuecomment-2236464052

Could be incorporated into new function altogether but proposing to build into existing generate as the logic is minimal...

Thanks 😄

farris avatar Oct 06 '24 04:10 farris

I actually did this myself when it first came up in the PR to introduce logprobs. Comment here: https://github.com/ml-explore/mlx-examples/pull/806#issuecomment-2211931951

Yours makes more sense from a library standpoint though. I would find it way more useful in utils, personally.

I use logprobs and the associated tokens/vocab quite often.

fblissjr avatar Oct 06 '24 19:10 fblissjr

I actually did this myself when it first came up in the PR to introduce logprobs. Comment here: #806 (comment)

Yours makes more sense from a library standpoint though. I would find it way more useful in utils, personally.

I use logprobs and the associated tokens/vocab quite often.

Nice, maybe the functionality should be shared between the server implementation which you did and the regular generate interface

@awni , thoughts?

farris avatar Oct 08 '24 02:10 farris