We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am trying the mlx-lm examples from your documentation: https://dottxt-ai.github.io/outlines/latest/reference/models/mlxlm/
I encounter 2 issues:
First issue: TypeError: MLXLM.generate() got an unexpected keyword argument 'temperature' I guess the syntax in documentation is no longer up to date.
TypeError: MLXLM.generate() got an unexpected keyword argument 'temperature'
Omitting the temperature argument, now I get:
Second issue: AttributeError: 'Model' object has no attribute 'n_kv_heads'
AttributeError: 'Model' object has no attribute 'n_kv_heads'
That happens with mlx-community/Phi-3.5-mini-instruct-4bit. Tried another model (mlx-community/Meta-Llama-3.1-8B-Instruct-4bit), got same error.
from outlines import models, generate model = models.mlxlm("mlx-community/Phi-3.5-mini-instruct-4bit") generator = generate.text(model) answer = generator("A prompt", temperature=2.0) # first issue answer = generator("A prompt") # second issue
no error
(tedson) miguel@Miguels-MacBook-Air tedson % python Python 3.11.10 (main, Oct 3 2024, 02:26:51) [Clang 14.0.6 ] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from outlines import models, generate >>> model = models.mlxlm("mlx-community/Phi-3.5-mini-instruct-4bit") Fetching 11 files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 11/11 [00:00<00:00, 102073.77it/s] >>> generator = generate.text(model) >>> answer = generator("A prompt", temperature=2.0) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/miguel/miniforge3/envs/tedson/lib/python3.11/site-packages/outlines/generate/api.py", line 504, in __call__ completions = self.model.generate( ^^^^^^^^^^^^^^^^^^^^ TypeError: MLXLM.generate() got an unexpected keyword argument 'temperature' >>> answer = generator("A prompt") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/miguel/miniforge3/envs/tedson/lib/python3.11/site-packages/outlines/generate/api.py", line 504, in __call__ completions = self.model.generate( ^^^^^^^^^^^^^^^^^^^^ File "/Users/miguel/miniforge3/envs/tedson/lib/python3.11/site-packages/outlines/models/mlxlm.py", line 41, in generate return "".join(list(streamer)) ^^^^^^^^^^^^^^ File "/Users/miguel/miniforge3/envs/tedson/lib/python3.11/site-packages/outlines/models/mlxlm.py", line 112, in stream for (token, prob), n in zip( File "/Users/miguel/miniforge3/envs/tedson/lib/python3.11/site-packages/outlines/models/mlxlm.py", line 172, in generate_step if isinstance(self.model.n_kv_heads, int) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/miguel/miniforge3/envs/tedson/lib/python3.11/site-packages/mlx/nn/layers/base.py", line 103, in __getattr__ super(Module, self).__getattribute__(key) AttributeError: 'Model' object has no attribute 'n_kv_heads'
Version information
Can't use mlx-ml outlines on my MacBook Air M2 24G. And transformer outlines performance is terrible on Apple Silicon.
The text was updated successfully, but these errors were encountered:
Have the same problem with "mlx-community/Llama-3.2-3B-Instruct-8bit" with the following version numbers:
mlx==0.19.3 mlx-lm==0.19.2 outlines==0.1.1 outlines_core==0.1.14
Sorry, something went wrong.
I have made a PR to fix this: #1260
Awesome, thank you! I hope it will be merged fast! :)
I confirm, the PR fix it
Successfully merging a pull request may close this issue.
Describe the issue as clearly as possible:
I am trying the mlx-lm examples from your documentation:
https://dottxt-ai.github.io/outlines/latest/reference/models/mlxlm/
I encounter 2 issues:
First issue:
TypeError: MLXLM.generate() got an unexpected keyword argument 'temperature'
I guess the syntax in documentation is no longer up to date.
Omitting the temperature argument, now I get:
Second issue:
AttributeError: 'Model' object has no attribute 'n_kv_heads'
That happens with mlx-community/Phi-3.5-mini-instruct-4bit. Tried another model (mlx-community/Meta-Llama-3.1-8B-Instruct-4bit), got same error.
Steps/code to reproduce the bug:
Expected result:
Error message:
Outlines/Python version information:
Version information
Context for the issue:
Can't use mlx-ml outlines on my MacBook Air M2 24G. And transformer outlines performance is terrible on Apple Silicon.
The text was updated successfully, but these errors were encountered: