weixin_72661020/ZhangLingzhe_ThinkFL-Qwen2.5-0.5B
模型介绍文件和版本Pull Requests讨论分析

ZhangLingzhe_ThinkFL-Qwen2.5-0.5B

1. 简介

ZhangLingzhe/ThinkFL-Qwen2.5-0.5B 是基于 Qwen2.5 0.5B 的文本生成模型。该模型依托 HuggingFace transformers 构建,支持一键加载并进行推理。 权重来源:ModelScope

2. 快速使用

import torch; from transformers import AutoTokenizer, AutoModelForCausalLM
device = torch.device("npu:0" if torch.npu.is_available() else "cpu")
tokenizer = AutoTokenizer.from_pretrained("ZhangLingzhe/ThinkFL-Qwen2.5-0.5B", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("ZhangLingzhe/ThinkFL-Qwen2.5-0.5B", torch_dtype=torch.float16, trust_remote_code=True).to(device).eval()
messages = [{"role": "user", "content": "什么是机器学习?"}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(device)
outputs = model.generate(**inputs, max_new_tokens=128, do_sample=False)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))

3. 精度评测

指标值
Top-1 一致性4/4
Max Logit Diff Ratio3e-05
Avg KL Divergence-0.0
结论PASS

4. 性能参考

NPU: 1722.85 ms(生成 64 个 tokens,fp16)

下载使用量0