Skip to content
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

Is the output format only a Stream? #208

Open
IkeuchiRyuto opened this issue Feb 19, 2025 · 1 comment
Open

Is the output format only a Stream? #208

IkeuchiRyuto opened this issue Feb 19, 2025 · 1 comment

Comments

@IkeuchiRyuto
Copy link

Is there a way to change the generation behavior to something other than Streaming?
mlx_lm has two methods: the normal "generate" method and the "generate_stream" method.
I want to output structured data, so generating it with streaming is not preferable.
If there is a way, please let me know.

Thank you.

@davidkoski
Copy link
Collaborator

I presume you are referring to generate()?

The callback didGenerate is indeed how you can observe (and control) the stream being generated, but if you consume the result you can get the full output text or tokens.

Is this what you are looking for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants