Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,26 +1,35 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
tags:
|
| 3 |
-
-
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
#
|
| 7 |
|
| 8 |
-
|
| 9 |
-
## Generated by ML Intern
|
| 10 |
|
| 11 |
-
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
## Usage
|
| 17 |
|
| 18 |
```python
|
| 19 |
-
from
|
| 20 |
|
| 21 |
-
|
| 22 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 23 |
-
model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 24 |
-
```
|
| 25 |
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
license_link: https://ai.google.dev/gemma/docs/gemma_4_license
|
| 5 |
+
pipeline_tag: image-text-to-text
|
| 6 |
tags:
|
| 7 |
+
- mlx
|
| 8 |
+
base_model: google/gemma-4-31B-it
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# raazkumar/gemma-4-31B-it-mlx-2Bit
|
| 12 |
|
| 13 |
+
The Model [raazkumar/gemma-4-31B-it-mlx-2Bit](https://huggingface.co/raazkumar/gemma-4-31B-it-mlx-2Bit) was converted to MLX format from [google/gemma-4-31B-it](https://huggingface.co/google/gemma-4-31B-it) using mlx-lm version **0.31.2**.
|
|
|
|
| 14 |
|
| 15 |
+
## Use with mlx
|
| 16 |
|
| 17 |
+
```bash
|
| 18 |
+
pip install mlx-lm
|
| 19 |
+
```
|
|
|
|
| 20 |
|
| 21 |
```python
|
| 22 |
+
from mlx_lm import load, generate
|
| 23 |
|
| 24 |
+
model, tokenizer = load("raazkumar/gemma-4-31B-it-mlx-2Bit")
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
+
prompt="hello"
|
| 27 |
+
|
| 28 |
+
if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
|
| 29 |
+
messages = [{"role": "user", "content": prompt}]
|
| 30 |
+
prompt = tokenizer.apply_chat_template(
|
| 31 |
+
messages, tokenize=False, add_generation_prompt=True
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
response = generate(model, tokenizer, prompt=prompt, verbose=True)
|
| 35 |
+
```
|