Instructions to use Hanversion/SunXiaochuan-V1-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Hanversion/SunXiaochuan-V1-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Hanversion/SunXiaochuan-V1-3B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Hanversion/SunXiaochuan-V1-3B") model = AutoModelForCausalLM.from_pretrained("Hanversion/SunXiaochuan-V1-3B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Hanversion/SunXiaochuan-V1-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Hanversion/SunXiaochuan-V1-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Hanversion/SunXiaochuan-V1-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Hanversion/SunXiaochuan-V1-3B
- SGLang
How to use Hanversion/SunXiaochuan-V1-3B 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 "Hanversion/SunXiaochuan-V1-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Hanversion/SunXiaochuan-V1-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Hanversion/SunXiaochuan-V1-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Hanversion/SunXiaochuan-V1-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Hanversion/SunXiaochuan-V1-3B with Docker Model Runner:
docker model run hf.co/Hanversion/SunXiaochuan-V1-3B
SunXiaochuan-V1-3B
1. 介绍
本模型基于Qwen2.5-3B-Instruct并使用Lora进行模型微调获得。数据集的使用来自 孙笑川吧 某些帖子中的回复及楼中楼回复,由于未对数据进行全面清理,故数据集质量与数量并不高。数据集可以从我的 HuggingFace数据集 中获得。除孙笑川吧数据外,还包括 弱智吧 、 中国人口吧 以及 航空母舰吧 的部分数据,数据来源日期为 2025-03-05。数据格式如下:
- question:帖子标题
- answer:帖子最热门的回复
- think:DeepSeek-V3所生成的思考链
本模型仅供学习使用,不保证模型真实性及有效性。
2. 训练介绍
本模型的训练使用了 LLaMA-Factory 作为微调工具,训练集样本大小为3000条数据,并且修改梯度累计为2,Lora秩为16,Lora+为16等,设备使用单卡4090训练1小时得到。具体训练Loss曲线如下:
同时,模型训练完成后,用其他500条数据进行数据预测和模型评估,得到如下结果:
{
"predict_bleu-4": 2.2241416,
"predict_model_preparation_time": 0.0043,
"predict_rouge-1": 13.033509999999998,
"predict_rouge-2": 1.3886417999999998,
"predict_rouge-l": 10.5493132,
"predict_runtime": 610.2644,
"predict_samples_per_second": 0.819,
"predict_steps_per_second": 0.41
}
3. 模型介绍
SunXiaochuan-V1
| 模型名称 | #总参数 | #微调参数 | 上下文长度 | 下载 |
|---|---|---|---|---|
| SunXiaochuan-V1-3B | 3B | 0.5B | 128K | 🤗 HuggingFace |
使用 Qwen2.5 进行训练,无思考推理过程
SunXiaochuan-R
| 模型名称 | #总参数 | #微调参数 | 上下文长度 | 下载 |
|---|---|---|---|---|
| DeepShit-R1-1.5B-Sunba-Distill | 1.5B | 1B | 128K | 🤗 HuggingFace |
| MAGA-T1-Tieba-1.5B-Distill | 1.5B | 2B | 128K | 🤗 HuggingFace |
基于 DeepSeek-R1 进行训练,加入思考推理过程
5. 联系
欢迎与我进行讨论,联系方式如下:
- Github:Hanversion
- Email:hanversion@outlook.com
- Downloads last month
- 10
