|
--- |
|
license: apache-2.0 |
|
pipeline_tag: text-generation |
|
library_name: mlx |
|
tags: |
|
- vllm |
|
- mlx |
|
base_model: openai/gpt-oss-20b |
|
--- |
|
|
|
# sealad886/gpt-oss-20b-MLX-native |
|
|
|
This model [sealad886/gpt-oss-20b-MLX-native](https://huggingface.co/sealad886/gpt-oss-20b-MLX-native) was |
|
converted to MLX format from [openai/gpt-oss-20b](https://huggingface.co/openai/gpt-oss-20b) |
|
using mlx-lm version **0.26.3**. |
|
|
|
> **Note:** command for conversion: |
|
> ```bash |
|
> mlx_lm.convert --hf-repo openai/gpt-oss-20b ... -q --q-bits 4 |
|
> ``` |
|
> |
|
> The version without doing an added 4-bit quant was in a 16-bit format (either bfloat16 or float16, I assume; I didn't check). |
|
|
|
## Use with mlx |
|
|
|
```bash |
|
pip install mlx-lm |
|
``` |
|
|
|
```python |
|
from mlx_lm import load, generate |
|
|
|
model, tokenizer = load("sealad886/gpt-oss-20b-MLX-native") |
|
|
|
prompt = "hello" |
|
|
|
if tokenizer.chat_template is not None: |
|
messages = [{"role": "user", "content": prompt}] |
|
prompt = tokenizer.apply_chat_template( |
|
messages, add_generation_prompt=True |
|
) |
|
|
|
response = generate(model, tokenizer, prompt=prompt, verbose=True) |
|
``` |
|
|