mlx-lm 0.0.0.dev8__tar.gz → 0.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/PKG-INFO +1 -1
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/mlx_lm/convert.py +9 -4
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/mlx_lm/models/phi2.py +2 -1
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/mlx_lm.egg-info/PKG-INFO +1 -1
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/setup.py +1 -1
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/MANIFEST.in +0 -0
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/README.md +0 -0
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/mlx_lm/__init__.py +0 -0
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/mlx_lm/generate.py +0 -0
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/mlx_lm/models/__init__.py +0 -0
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/mlx_lm/models/base.py +0 -0
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/mlx_lm/models/llama.py +0 -0
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/mlx_lm/requirements.txt +0 -0
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/mlx_lm/utils.py +0 -0
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/mlx_lm.egg-info/SOURCES.txt +0 -0
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/mlx_lm.egg-info/dependency_links.txt +0 -0
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/mlx_lm.egg-info/requires.txt +0 -0
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/mlx_lm.egg-info/top_level.txt +0 -0
- {mlx-lm-0.0.0.dev8 → mlx-lm-0.0.2}/setup.cfg +0 -0
|
@@ -149,11 +149,16 @@ def upload_to_hub(path: str, upload_repo: str, hf_path: str):
|
|
|
149
149
|
This model was converted to MLX format from [`{hf_path}`]().
|
|
150
150
|
Refer to the [original model card](https://huggingface.co/{hf_path}) for more details on the model.
|
|
151
151
|
## Use with mlx
|
|
152
|
+
|
|
152
153
|
```bash
|
|
153
|
-
pip install mlx
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
python
|
|
154
|
+
pip install mlx-lm
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
from mlx_lm import load, generate
|
|
159
|
+
|
|
160
|
+
model, tokenizer = load("{upload_repo}")
|
|
161
|
+
response = generate(model, tokenizer, prompt="hello", verbose=True)
|
|
157
162
|
```
|
|
158
163
|
"""
|
|
159
164
|
card.save(os.path.join(path, "README.md"))
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import math
|
|
2
2
|
from dataclasses import dataclass
|
|
3
|
+
from typing import Tuple
|
|
3
4
|
|
|
4
5
|
import mlx.core as mx
|
|
5
6
|
import mlx.nn as nn
|
|
@@ -128,7 +129,7 @@ class Model(nn.Module):
|
|
|
128
129
|
x: mx.array,
|
|
129
130
|
mask: mx.array = None,
|
|
130
131
|
cache: mx.array = None,
|
|
131
|
-
) ->
|
|
132
|
+
) -> Tuple[mx.array, mx.array]:
|
|
132
133
|
mask = None
|
|
133
134
|
if x.shape[1] > 1:
|
|
134
135
|
mask = nn.MultiHeadAttention.create_additive_causal_mask(x.shape[1])
|
|
@@ -8,7 +8,7 @@ with open(Path(__file__).parent / "mlx_lm/requirements.txt") as fid:
|
|
|
8
8
|
requirements = [str(r) for r in pkg_resources.parse_requirements(fid)]
|
|
9
9
|
setup(
|
|
10
10
|
name="mlx-lm",
|
|
11
|
-
version="0.0.
|
|
11
|
+
version="0.0.2",
|
|
12
12
|
description="LLMs on Apple silicon with MLX and the Hugging Face Hub",
|
|
13
13
|
long_description=open("README.md", encoding="utf-8").read(),
|
|
14
14
|
long_description_content_type="text/markdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|