Skip to content

Instantly share code, notes, and snippets.

View eustlb's full-sized avatar

eustlb

  • Hugging Face
  • Paris, France
View GitHub Profile
@eustlb
eustlb / .gitignore
Last active October 20, 2026 18:44
transformers: Gradium Phonon TTS integration-test goldens, from Gradium's runtime (ptts 0.4.0)
out/
__pycache__/
.media/
@eustlb
eustlb / .gitignore
Last active October 19, 2026 22:07
Pocket TTS: integration-test goldens for huggingface/transformers (reproducers from the original kyutai-labs/pocket-tts + HF Jobs)
out/
__pycache__/
.media/
@eustlb
eustlb / .gitignore
Last active October 19, 2026 09:39
Pocket TTS audio tokenizer: integration-test goldens for huggingface/transformers (reproducers + HF Jobs)
out/
__pycache__/
.media/
"""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"
@eustlb
eustlb / branch.patch
Last active October 13, 2026 17:47
EmbeddingGemma 2 integration-test reproducers (transformers @ 92cd495f27 as reference)
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``,
"""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
@eustlb
eustlb / pyproject.toml
Created July 10, 2026 15:58
Reference reproducers for the HF GraniteSpeechNarForCTC test fixtures (from the original ibm-granite/granite-speech-4.1-2b-nar remote-code model, single-pass CTC)
[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"
@eustlb
eustlb / _hf_capture.py
Last active June 24, 2026 15:20
NeMo reference reproducers for HF Nemotron3_5AsrForRNNT integration-test fixtures (nvidia/nemotron-3.5-asr-streaming-0.6b)
"""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)
"""
@eustlb
eustlb / _hf_capture.py
Created June 10, 2026 18:54
nemotron-asr reproducers (single/batch/streaming RNNT)
"""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
@eustlb
eustlb / _hf_capture.py
Created June 10, 2026 10:17
NeMo reference reproducers for HF NemotronAsrForRNNT integration-test fixtures (nvidia/nemotron-speech-streaming-en-0.6b)
"""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