This repository provides a minimal NPU-only inference entrypoint for
philschmid/layoutlm-funsd. It loads fixed revision
5dc97b05b27e5efed5f331a2216726dd7b338e43 and executes the full
LayoutLMForTokenClassification forward pass on an Ascend NPU.
The upstream model snapshot is not redistributed here.
git clone https://gitcode.com/2301_78565107/layoutlm-funsd.git repo
git clone --no-checkout https://gitcode.com/hf_mirrors/philschmid/layoutlm-funsd.git model
git -C model checkout 5dc97b05b27e5efed5f331a2216726dd7b338e43
git -C model lfs pull
python3 -m pip install --target ./repo/pydeps -r ./repo/requirements.txt
cd repo
source /usr/local/Ascend/ascend-toolkit/set_env.sh
export TORCH_DEVICE_BACKEND_AUTOLOAD=0
PYTHONPATH="$PWD/pydeps" python3 inference.py \
--model-dir ../model --device npu:0 \
--samples 8 --sequence-length 32 --output result.jsonThe official hosted rerun passed with CANN 8.5.1, platform PyTorch 2.9.0 and
torch_npu 2.9.0. The public model snapshot and requirements.txt are the
complete recovery contract; no private AUX or hidden Python module is needed.
The script refuses non-NPU devices. The JSON result records device-chain fields, shape/count, finite/non-finite counts, timing, and exit status. There is no CPU/CUDA inference bridge or fallback.
The two DS-V4-Flash workflow views are independent plan-only conversations: an overall Ascend NPU migration design and a separate dependency, operator, full-NPU validation, and troubleshooting plan. They do not execute tools or modify repository files.


本仓为 2301_76761127 队伍交付件(与备份账号合并提交)。