Instructions to use Yuaz-Club/yuaz-mini-cheng-dx-1b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Yuaz-Club/yuaz-mini-cheng-dx-1b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Yuaz-Club/yuaz-mini-cheng-dx-1b", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Yuaz-Club/yuaz-mini-cheng-dx-1b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Yuaz-Club/yuaz-mini-cheng-dx-1b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Yuaz-Club/yuaz-mini-cheng-dx-1b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Yuaz-Club/yuaz-mini-cheng-dx-1b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Yuaz-Club/yuaz-mini-cheng-dx-1b
- SGLang
How to use Yuaz-Club/yuaz-mini-cheng-dx-1b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Yuaz-Club/yuaz-mini-cheng-dx-1b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Yuaz-Club/yuaz-mini-cheng-dx-1b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Yuaz-Club/yuaz-mini-cheng-dx-1b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Yuaz-Club/yuaz-mini-cheng-dx-1b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Yuaz-Club/yuaz-mini-cheng-dx-1b with Docker Model Runner:
docker model run hf.co/Yuaz-Club/yuaz-mini-cheng-dx-1b
Yuaz-mini-Cheng DX 1B
从零训练的 972M 参数中文对话模型。基于 LCCC + NaturalConv 数据集。
使用方法
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"Yuaz-Club/yuaz-mini-cheng-dx-1b",
trust_remote_code=True,
torch_dtype=torch.float16
)
tokenizer = AutoTokenizer.from_pretrained("Yuaz-Club/yuaz-mini-cheng-dx-1b", trust_remote_code=True)
inputs = tokenizer("你好", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=60)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
模型参数
| 参数 | 值 |
|---|---|
| 参数量 | 972M |
| 层数 | 28 |
| 隐藏层 | 1792 |
| 注意力头 | 28 (GQA 4:1, 7 KV heads) |
| FFN | 4864 (SwiGLU) |
| 词表 | 8192 (BPE) |
| 位置编码 | RoPE |
| 训练数据 | 314 万对话 |
模型文件
| 文件 | 大小 | 格式 |
|---|---|---|
pytorch_model.bin |
1.8 GB | FP16 |
- Downloads last month
- 9