Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: transformers
|
3 |
+
license: gemma
|
4 |
+
license_link: https://ai.google.dev/gemma/terms
|
5 |
+
extra_gated_heading: Access CodeGemma on Hugging Face
|
6 |
+
extra_gated_prompt: To access CodeGemma on Hugging Face, you’re required to review
|
7 |
+
and agree to Google’s usage license. To do this, please ensure you’re logged-in
|
8 |
+
to Hugging Face and click below. Requests are processed immediately.
|
9 |
+
extra_gated_button_content: Acknowledge license
|
10 |
+
tags:
|
11 |
+
- mlx
|
12 |
+
base_model: google/codegemma-1.1-2b
|
13 |
+
---
|
14 |
+
|
15 |
+
# mlx-community/codegemma-1.1-2b-6bit
|
16 |
+
|
17 |
+
The Model [mlx-community/codegemma-1.1-2b-6bit](https://huggingface.co/mlx-community/codegemma-1.1-2b-6bit) was converted to MLX format from [google/codegemma-1.1-2b](https://huggingface.co/google/codegemma-1.1-2b) using mlx-lm version **0.24.1**.
|
18 |
+
|
19 |
+
## Use with mlx
|
20 |
+
|
21 |
+
```bash
|
22 |
+
pip install mlx-lm
|
23 |
+
```
|
24 |
+
|
25 |
+
```python
|
26 |
+
from mlx_lm import load, generate
|
27 |
+
|
28 |
+
model, tokenizer = load("mlx-community/codegemma-1.1-2b-6bit")
|
29 |
+
|
30 |
+
prompt="hello"
|
31 |
+
|
32 |
+
if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
|
33 |
+
messages = [{"role": "user", "content": prompt}]
|
34 |
+
prompt = tokenizer.apply_chat_template(
|
35 |
+
messages, tokenize=False, add_generation_prompt=True
|
36 |
+
)
|
37 |
+
|
38 |
+
response = generate(model, tokenizer, prompt=prompt, verbose=True)
|
39 |
+
```
|