凤
weixin_44093752/beaver-7b-v1-cost-ascend-npu
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

Beaver 7B cost model Ascend NPU smoke adaptation

This delivery tracks the official PKU-Alignment/beaver-7b-v1.0-cost checkpoint and the score-model implementation from PKU-Alignment Safe-RLHF:

  • model: https://huggingface.co/PKU-Alignment/beaver-7b-v1.0-cost
  • revision: c1bd343d2ddc2cb810bd736563c7ad0bf38f6b28
  • source: https://github.com/PKU-Alignment/safe-rlhf
  • source revision: e8cca16665ef2340ac92c6514f05519310251581
  • architecture: LlamaForScore, 6,607,351,809 parameters
  • weights: seven safetensors shards, exact sizes and LFS hashes recorded in model-lock.json

The official repository imports training-only dependencies at package import time. This adaptation vendors the official normalizer, score-model base and Llama score implementation, then loads only those files so the inference path does not require wandb or deepspeed. The cost model was loaded from the actual checkpoint and forwarded on npu:0 with a [1,16] smoke input. The output was finite with score shape [1,16,1] and end-score shape [1,1].

The verified environment uses Transformers 4.46.3, tokenizers 0.20.3 and huggingface-hub 0.26.2. This is the requested NPU smoke gate only; it does not claim cost calibration, task quality or CPU/NPU precision equivalence.

Run with the checkpoint outside this repository:

PYTHONPATH=/path/to/transformers-4.46.3 python inference.py \\
  --model-path /tmp/model-agent/beaver-7b-v1-cost \\
  --device npu --output-dir validation

Model Agent CPU/NPU workflow

Ascend NPU device call

NPU smoke result