Signed-off-by: Thang Nguyen <thangnguyenvn647@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f590eb2448
commit
7cfd233538
@@ -104,16 +104,7 @@ def run_test(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize("model", ["nvidia/NVIDIA-Nemotron-Parse-v1.2"])
|
||||||
"model",
|
|
||||||
[
|
|
||||||
"nvidia/NVIDIA-Nemotron-Parse-v1.2",
|
|
||||||
# v2.0's checkpoint ties lm_head to the decoder's input embeddings
|
|
||||||
# instead of shipping a separate lm_head.weight tensor; this
|
|
||||||
# exercises that path (see tie_weights() in nemotron_parse.py).
|
|
||||||
"nvidia/NVIDIA-Nemotron-Parse-2.0",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
@pytest.mark.parametrize("dtype", ["bfloat16"])
|
@pytest.mark.parametrize("dtype", ["bfloat16"])
|
||||||
@pytest.mark.parametrize("num_logprobs", [5])
|
@pytest.mark.parametrize("num_logprobs", [5])
|
||||||
def test_models(
|
def test_models(
|
||||||
|
|||||||
@@ -568,15 +568,6 @@ class NemotronParseForConditionalGeneration(nn.Module, SupportsMultiModal):
|
|||||||
self.lm_head = ParallelLMHead(
|
self.lm_head = ParallelLMHead(
|
||||||
config.decoder.vocab_size, config.decoder.d_model, quant_config=quant_config
|
config.decoder.vocab_size, config.decoder.d_model, quant_config=quant_config
|
||||||
)
|
)
|
||||||
# Some checkpoints (e.g. compact exports) tie the output head to the
|
|
||||||
# decoder's input embeddings instead of materializing a separate
|
|
||||||
# lm_head.weight tensor.
|
|
||||||
tie_word_embeddings = bool(
|
|
||||||
getattr(config, "tie_word_embeddings", False)
|
|
||||||
or getattr(config.decoder, "tie_word_embeddings", False)
|
|
||||||
)
|
|
||||||
if tie_word_embeddings:
|
|
||||||
self.lm_head = self.lm_head.tie_weights(self.decoder.embed_tokens)
|
|
||||||
self.logits_processor = LogitsProcessor(
|
self.logits_processor = LogitsProcessor(
|
||||||
self.vocab_size, config.decoder.vocab_size
|
self.vocab_size, config.decoder.vocab_size
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user