Commit aa2692e
authored
fix(evo2): replace removed _HuggingFaceTokenizer import (NVIDIA-BioNeMo#1595)
## Summary
Fix `ImportError: cannot import name '_HuggingFaceTokenizer' from
'megatron.bridge.training.tokenizers.tokenizer'` in the evo2 lora
fine-tuning notebook CI test.
### Root Cause
Megatron-Bridge v0.4.1 removed the `_HuggingFaceTokenizer` class from
`megatron.bridge.training.tokenizers.tokenizer`. The evo2_classifier.py
script still imported and used it.
### Changes
- **Import**: `_HuggingFaceTokenizer` → `HuggingFaceTokenizer` from
`megatron.core.tokenizers.text.libraries.huggingface_tokenizer`
- **All type annotations and constructor calls** updated to use the new
class name
- **Pad token access**: `tokenizer.pad` → `tokenizer.pad_id` (with
broadened except for backwards compat)
- The existing `hasattr(tokenizer, "tokenize")` guard already handles
the method rename (`tokenize()` → `text_to_ids()`)
### Testing
- Pre-commit passes
- 1 file changed, 8 insertions, 8 deletions (minimal diff)
### CI failure
https://github.com/NVIDIA-BioNeMo/bionemo-framework/actions/runs/26790293271/job/78975043946
Signed-off-by: svc-bionemo <267129667+svc-bionemo@users.noreply.github.com>
Co-authored-by: svc-bionemo <267129667+svc-bionemo@users.noreply.github.com>1 parent 40d64e0 commit aa2692e
1 file changed
Lines changed: 8 additions & 8 deletions
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
| |||
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
| 318 | + | |
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
326 | | - | |
| 325 | + | |
| 326 | + | |
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
381 | | - | |
| 381 | + | |
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
| |||
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
709 | | - | |
| 709 | + | |
710 | 710 | | |
711 | 711 | | |
712 | 712 | | |
| |||
750 | 750 | | |
751 | 751 | | |
752 | 752 | | |
753 | | - | |
| 753 | + | |
754 | 754 | | |
755 | | - | |
| 755 | + | |
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
| |||
0 commit comments