lwgena's picture
Update README.md
3ab1766 verified
metadata
license: mit
language:
  - ja
pipeline_tag: text-generation
base_model: sbintuitions/sarashina2.2-0.5b-instruct-v0.1
library_name: mlx
tags:
  - mlx

mlx-community/sarashina2.2-0.5b-instruct-v0.1

This model mlx-community/sarashina2.2-0.5b-instruct-v0.1 was converted to MLX format from sbintuitions/sarashina2.2-0.5b-instruct-v0.1 using mlx-lm version 0.25.2.

Use with mlx

Please ensure your mlx version is 0.26.2 or newer. You can upgrade mlx using: pip install --upgrade mlx

pip install mlx-lm
from mlx_lm import load, generate

model, tokenizer = load("mlx-community/sarashina2.2-0.5b-instruct-v0.1")

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)