This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| out/ | |
| __pycache__/ | |
| .media/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| out/ | |
| __pycache__/ | |
| .media/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| out/ | |
| __pycache__/ | |
| .media/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Minimal demo: {% generation %} -> assistant_masks -> labels -> loss, Llama 3.1 8B. | |
| Run with --forward to also load the model and compute the masked loss. | |
| """ | |
| import sys | |
| import torch | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| MODEL = "meta-llama/Llama-3.1-8B-Instruct" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/tests/models/embedding_gemma2/test_modeling_embedding_gemma2.py b/tests/models/embedding_gemma2/test_modeling_embedding_gemma2.py | |
| index 9fb1f65e87..d4ad39242b 100644 | |
| --- a/tests/models/embedding_gemma2/test_modeling_embedding_gemma2.py | |
| +++ b/tests/models/embedding_gemma2/test_modeling_embedding_gemma2.py | |
| @@ -464,18 +464,19 @@ class EmbeddingGemma2ModelTest(ModelTesterMixin, unittest.TestCase): | |
| class EmbeddingGemma2IntegrationTest(MemoryCleanupMixin, unittest.TestCase): | |
| """ | |
| reproducer (uploads the golden to | |
| - ``hf://buckets/hf-internal-testing/embeddinggemma2-integration-test/<case>/expected_embeddings.safetensors``, | |
| + ``hf://buckets/hf-internal-testing/embeddinggemma2-integration-tests/<case>/expected_embeddings.safetensors``, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Regenerates the fixtures used by `GraniteSpeech5ForCTCIntegrationTest`. | |
| python tests/models/granite_speech5/reproducer.py | |
| Everything comes from the original remote-code implementation, so the fixtures are an independent | |
| reference rather than a snapshot of the port's own output. | |
| """ | |
| import json | |
| import pathlib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [project] | |
| name = "granite-speech-nar-reproducers" | |
| version = "0.0.0" | |
| description = "Reference reproducers for the HF GraniteSpeechNarForCTC test fixtures, from the original remote-code model." | |
| # Pinned to the transformers version the original checkpoint was authored against | |
| # (`config.json` -> `transformers_version: 5.8.0.dev0`), so the remote-code model reproduces exactly. | |
| # An isolated env is required: the transformers dev checkout under test natively registers the | |
| # `granite_speech_nar` model_type, which would clash with the repo's `trust_remote_code` classes. | |
| requires-python = ">=3.10,<3.13" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Capture the HF Nemotron3_5AsrForRNNT outputs to bake into the integration tests. | |
| Not a reproducer (those are the NeMo reference). This runs the *HF* model on the same audio the tests | |
| use, conditioned on the language prompt `language="en-US"` (the test samples are English): | |
| - offline single (librispeech_asr_dummy sample 0, default att_context [56, 3]) | |
| - offline batched (librispeech_asr_dummy samples 0..4, default att_context [56, 3]) | |
| - streaming (obama.mp3, num_lookahead_tokens=6 i.e. att_context [56, 6], mel-frame chunks 49 then 56) | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Capture the HF NemotronAsrForRNNT outputs to bake into the integration tests. | |
| Not a reproducer (those are NeMo reference). This runs the *HF* model on the same audio the tests use: | |
| - offline single (librispeech_asr_dummy sample 0, default att_context) | |
| - offline batched (librispeech_asr_dummy samples 0..4) | |
| - streaming (obama.mp3, att_context_size=[70, 6], mel-frame chunks 49 then 56) | |
| and prints JSON so the exact HF strings can be pasted into EXPECTED_* in the test. | |
| """ | |
| import json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Capture the HF NemotronAsrForRNNT outputs to bake into the integration tests. | |
| Not a reproducer (those are NeMo reference). This runs the *HF* model on the same audio the tests use: | |
| - offline single (librispeech_asr_dummy sample 0, default att_context) | |
| - offline batched (librispeech_asr_dummy samples 0..4) | |
| - streaming (obama.mp3, att_context_size=[70, 6], mel-frame chunks 49 then 56) | |
| and prints JSON so the exact HF strings can be pasted into EXPECTED_* in the test. | |
| """ | |
| import json |
NewerOlder