--- language: en library_name: mlx pipeline_tag: text-generation tags: - mlx - hunyuan - hy4 - moe - text-generation license: apache-2.0 base_model: tencent/Hy4-preview --- # mlx-community/Hy4-preview-4bit This model [mlx-community/Hy4-preview-4bit](https://huggingface.co/mlx-community/Hy4-preview-4bit) was converted to MLX format from [tencent/Hy4-preview](https://huggingface.co/tencent/Hy4-preview) using mlx-lm version **0.32.0**. ## Use with mlx This model requires Hy4-preview support from the [add-hy4-preview](https://github.com/kernelpool/mlx-lm/tree/add-hy4-preview) branch, which is not yet included in an mlx-lm release. Until it is, install mlx-lm from the branch: ```bash pip install git+https://github.com/kernelpool/mlx-lm.git@add-hy4-preview ``` ```python from mlx_lm import load, generate model, tokenizer = load("mlx-community/Hy4-preview-4bit") 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) ```