metadata
library_name: mlx
license: other
license_link: https://huggingface.co/tencent/Youtu-LLM-2B/LICENSE.txt
pipeline_tag: text-generation
base_model: tencent/Youtu-LLM-2B
tags:
- mlx
mlx-community/Youtu-LLM-2B-mlx
This model mlx-community/Youtu-LLM-2B-mlx was converted to MLX format from tencent/Youtu-LLM-2B using mlx-lm version 0.30.0.
Use with mlx
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("mlx-community/Youtu-LLM-2B-mlx")
prompt = "hello"
if tokenizer.chat_template is not None:
messages = [{"role": "user", "content": prompt}]
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_dict=False,
)
response = generate(model, tokenizer, prompt=prompt, verbose=True)