---
title: Hunyuan-7B-Instruct-4bit
canonical_url: "https://www.modelscope.cn/models/mlx-community/Hunyuan-7B-Instruct-4bit"
md_url: "https://www.modelscope.cn/models/mlx-community/Hunyuan-7B-Instruct-4bit.md"
repository: mlx-community/Hunyuan-7B-Instruct-4bit
last_updated: 2025-02-11
license: other
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - hunyuan
architectures:
  - HunYuanForCausalLM
base_model:
  - tencent/Hunyuan-7B-Instruct
base_model_relation: quantized
parameters: 1.2B
tensor_type:
  - U32
  - F16
library_name:
  - mlx
  - safetensors
  - pytorch
frameworks:
  - pytorch
language:
  - en
downloads: 694
stars: 0
tags:
  - mlx
---

# Hunyuan-7B-Instruct-4bit

> Hunyuan-7B-Instruct-4bit - mlx-community 在 ModelScope 开源的模型。mlx-community/Hunyuan-7B-Instruct-4bit

mlx-community/Hunyuan-7B-Instruct-4bit 是 ModelScope 魔搭社区上的 1.2B 参数text-generation模型，采用 other 许可，基于 tencent/Hunyuan-7B-Instruct 构建。

- **Repository**: mlx-community/Hunyuan-7B-Instruct-4bit
- **License**: other
- **Tasks**: text-generation
- **Parameters**: 1.2B
- **Base model**: tencent/Hunyuan-7B-Instruct
- **Tags**: mlx
- **Downloads**: 694
- **Stars**: 0
- **Last updated**: 2025-02-11

Source: https://www.modelscope.cn/models/mlx-community/Hunyuan-7B-Instruct-4bit

---

# mlx-community/Hunyuan-7B-Instruct-4bit

The Model [mlx-community/Hunyuan-7B-Instruct-4bit](https://huggingface.co/mlx-community/Hunyuan-7B-Instruct-4bit) was
converted to MLX format from [tencent/Hunyuan-7B-Instruct](https://huggingface.co/tencent/Hunyuan-7B-Instruct)
using mlx-lm version **0.21.0**.

## Use with mlx

```bash
pip install mlx-lm
```

```python
from mlx_lm import load, generate

model, tokenizer = load("mlx-community/Hunyuan-7B-Instruct-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
    )

response = generate(model, tokenizer, prompt=prompt, verbose=True)
```
