Download nemotron-ocr/cpp/beam_decode/prefix.cpp from Metausermac13/nemotron-ocr-v2: direct link, hf CLI and curl.
- Browser
- Download file 452 Bytes
-
https://huggingface.co/Metausermac13/nemotron-ocr-v2/resolve/main/nemotron-ocr/cpp/beam_decode/prefix.cpp
- Command line
-
hf download hf://Metausermac13/nemotron-ocr-v2/nemotron-ocr/cpp/beam_decode/prefix.cpp
-
curl -L -o prefix.cpp https://huggingface.co/Metausermac13/nemotron-ocr-v2/resolve/main/nemotron-ocr/cpp/beam_decode/prefix.cpp
452 Bytes
| // SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | |
| // SPDX-License-Identifier: Apache-2.0 | |
| using namespace std; | |
| vector<token_t> Prefix::ToList() const | |
| { | |
| vector<token_t> ret; | |
| auto curr = this; | |
| while (curr) { | |
| if (curr->Token != 0) { | |
| ret.push_back(curr->Token); | |
| } | |
| curr = curr->Parent; | |
| } | |
| return { rbegin(ret), rend(ret) }; | |
| } | |