nimz12 commited on
Commit
d05246c
1 Parent(s): 759d2b0

Upload 2 files

Browse files
Files changed (2) hide show
  1. README.md +57 -3
  2. mamba2-1.3b-4bit-mlx.safetensors +3 -0
README.md CHANGED
@@ -1,3 +1,57 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - mamba
7
+ - mlx
8
+ - cartesia
9
+ ---
10
+
11
+ # Model Card for mamba2-1.3b-4bit-mlx
12
+
13
+ This is an [MLX](https://ml-explore.github.io/mlx)-compatible version of the [mamba2-1.3b](https://huggingface.co/state-spaces/mamba2-1.3b) model, quantized to 4 bits. It uses the [EleutherAI/gpt-neox-20b](https://huggingface.co/EleutherAI/gpt-neox-20b) tokenizer.
14
+ For more details, see our [blog post](https://cartesia.ai/blog/on-device).
15
+
16
+ ## Usage
17
+ ### Installation
18
+ This model requires the `cartesia-metal` and `cartesia-mlx` packages.
19
+
20
+ Installation requires Xcode, which can be downloaded from https://developer.apple.com/xcode/. Accept the license agreement with:
21
+ ```shell
22
+ sudo xcodebuild -license
23
+ ```
24
+
25
+ Install the required dependencies: the exact version of `nanobind`, followed by `cartesia-metal`, and finally `cartesia-mlx`, with the following commands:
26
+ ```shell
27
+ pip install nanobind@git+https://github.com/wjakob/nanobind.git@2f04eac452a6d9142dedb957701bdb20125561e4
28
+ pip install git+https://github.com/cartesia-ai/edge.git#subdirectory=cartesia-metal
29
+ pip install cartesia-mlx
30
+ ```
31
+
32
+ Note: This package has been tested on macOS Sonoma 14.1 with the M3 chip.
33
+
34
+ ### Generation example
35
+ ```python
36
+ import mlx.core as mx
37
+ import cartesia_mlx as cmx
38
+
39
+ model = cmx.from_pretrained("cartesia-ai/mamba2-1.3b-4bit-mlx")
40
+ model.set_dtype(mx.float32)
41
+
42
+ prompt = "Rene Descartes was"
43
+
44
+ print(prompt, end="", flush=True)
45
+ for text in model.generate(
46
+ prompt,
47
+ max_tokens=500,
48
+ eval_every_n=5,
49
+ verbose=True,
50
+ top_p=0.99,
51
+ temperature=0.85,
52
+ ):
53
+ print(text, end="", flush=True)
54
+ ```
55
+
56
+ ## About Cartesia
57
+ At [Cartesia](https://cartesia.ai/), we're building real-time multimodal intelligence for every device.
mamba2-1.3b-4bit-mlx.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:346fcb758b5772a610f2e9128280ed413fe64a57946e7e6afd33ea7286ef90f7
3
+ size 963858470