weixin_72661020/Trelis_multi-qa-MiniLM-L6-cos-v1-ft-pairs-2-cos-epoch-s20
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

Trelis/multi-qa-MiniLM-L6-cos-v1-ft-pairs-2-cos-epoch-s20

ModelScope:Trelis/multi-qa-MiniLM-L6-cos-v1-ft-pairs-2-cos-epoch-s20 | GitCode:Trelis/multi-qa-MiniLM-L6-cos-v1-ft-pairs-2-cos-epoch-s20

NPU适配精度

指标值
Top-1 一致性N/A (embedding)
Max Logit Diff Ratio0.000746
Avg KL Divergence0
权重大小86.7MB
设备Ascend 910B NPU

使用方式

from transformers import AutoTokenizer, BertModel
import torch

tok = AutoTokenizer.from_pretrained("/opt/atomgit/~/output/Trelis_multi-qa-MiniLM-L6-cos-v1-ft-pairs-2-cos-epoch-s20/model/Trelis/multi-qa-MiniLM-L6-cos-v1-ft-pairs-2-cos-epoch-s20", trust_remote_code=True)
model = BertModel.from_pretrained("/opt/atomgit/~/output/Trelis_multi-qa-MiniLM-L6-cos-v1-ft-pairs-2-cos-epoch-s20/model/Trelis/multi-qa-MiniLM-L6-cos-v1-ft-pairs-2-cos-epoch-s20", trust_remote_code=True).to("npu:0").eval()

inputs = tok(["测试文本"], return_tensors="pt", padding=True, truncation=True, max_length=128)
inputs = {k: v.to("npu:0") for k, v in inputs.items()}

with torch.no_grad():
    outputs = model(**inputs)

print(outputs.last_hidden_state.shape if hasattr(outputs, "last_hidden_state") else outputs.logits.shape)

文件说明

  • inference.py — 昇腾 NPU 推理脚本
  • eval/run_accuracy.py — 精度验证脚本
  • eval/run_performance.py — 性能测试脚本
  • eval/accuracy.json — 精度验证结果
  • eval/performance.json — 性能测试结果