transformers
640a08a5 - Implement VibeVoice (#40546)

Commit
95 days ago
Implement VibeVoice (#40546) * Cleanup and refactor. * Cleanup and standardization. * More cleanup and standardization. * Some simplification. * Cleaner streaming conv. * Nits. * Nits. * Cache like past_key_values * Further cleanup and optimization. * Update modular and generate. * Standardize config. * Update acoustic tokenizer config and encoder. * Switch to new acoustic cache object. * Update stem and head layers. * Remove Block1D and sub-components. * Cleanup. * Simplify conv transpose. * Remove nested Sequential * Simpler tokenizer forward. * Simplify forward and removed unused paths. * Further simplify StreamingConvTranspose1d. * Better variable naming. * Init doc file. * Futher cleanup: remove code paths, cleaner outputs. * Update modular. * Freeze tokenizers for main model. * Use noise scheduler from diffusers library. * Shift diffusion head to main modeling. * Cleanup timestep embedder. * Clean up diffusion modeling. * Clean up diffusion model layers. * DIffusion and main model cleanup. * Merge into single modeling file. * Shift layer idx to initialization. * Update tokenizer modular for new layer idx logic. * Consolidate into single modeling, create generation file. * Nits * Main model from modular. * Tokenizer from modular. * MLP from Llama. * Full conversion script, processor cleanup, nits * Cache similar to Mimi, single update method. * Make style * Clean up feature extractor * Cache simplifications. * StreamingConv1d nits * Nits for causal conv layers. * Batch tokenizer in processor. * Processor cleanup. * Remove diffusers dependency for timestep embedder. * Small cleanup for generation. * Shift noise scheduler to generation and remove diffusers dependency. * Timestep embedding nits. * Clean up generate. * Standardize config. * Add generation config to conversion script. * Modeling cleanup and standardization. * Flatten model structure, more cleanup * Use model config in generation. * Remove diffusers import utilities. * Make style * Generation nits. * Shift progress bar out of generation method. * Nits. * Use super generate. * Use stopping criteria and synced GPU * Interleave Vibevoice specific with base class as in CSM * Nit * Add feature extraction tests. * More conventional fast tokenizer. * Remove custom tokenizer, add chat template. * Shift text sequence preparation to chat template. * Correct spacing in chat template. * Fixes for equivalent output. * Fixes to generate method. * Start modeling tests, integration test works. * Address some modeling tests. * Address more modeling tests. * Update conversion script to handle 7B model * Feature extractor nits. * Simplify and standardize generation. * Add blank line * Cleanup. * Cleanup. * Remove original. * remove test files. * Cleanup. * [standardization] rename output to audio * Fix processor usage. * Remove audio embedding. * Add faeture extractor config to vibevoice tokenizers. * Address modeling tests. * Feature extraction tests. * Start processing tests. * Format * Reorg like llava * Address processor tests. * Clean up init weights. * Add tokenizer tests. * add diffusers decorator for testing * Remove batch mask to keep full batch for tokenizers, and simplify padding cache. * Remove batch mask from tests. * Code style/quality * Nits * Docs skeleton and style nits. * Update docs and usage. * Tokenizer nits. * Cleanup and make auto device work. * Simplify save_audio method * Nits. * model classes needing **kwargs in their forward * Updated expected output from runner. * Skip failing parallelism tests for audio tokenizers. * Make diffusion head modular instead of pretrained model. * Shift semantic tokenizer into main model. * Update auto config. * Nit for better modular. * Remove semantic forward. * Nits. * Functional after merge with main, but output empty audio... * Nits * Correct initialization and style * Simplify _prepare_generation_config now that base class logic is simplified. * Simpler vae_std * Conform to modular naming. * Style nits * tests nits * change checkpoint * processor tests nits * Remove cache from acoustic tokenizer encode. * Redesign decoder. * Redesign encoder. * Update semantic model * Access vae_std through the config * Modular on mimi cache * Update generation custom key logic * Remove extra model variables. * Address various comments * Pruning from vibevoice generation. * Move feature extractor to tokenizer. * Direct modular from mimi cache * Better encoder and decoder definition. * Refactor padding_mask and move reshaping to modeling * Shift sampling out of encode method. * Nits. * Separate conversion script for audio tokenizer. * Generation cleanup. * Further generation cleanup * Sync with latest _sample * Further cleanup of generation. * Propagate modular changes from tokenizer * make style * Clean up convert script. * Update doc and fixes for device map loading. * Nits / cleanup * Simpler timestep embedder + style * Processor nits * More processor nits * WIP diffusion loss * Check only acoustic loss mask for diffusion loss * Better base model output. * Reintroduce csm specific code blocks after latest _sample update. * Remove incomplete diffusion loss calculation. * Tokenizer changes. * Nit naming * Update conversion and usage after tokenizer merge. * Config via modular * Shift generation parameters to model config. * Cleanup and nits * nits * Add diffusion loss, and some standardization. * Feature extraction fixes that are in ASR PR. * Revent back to tokenizer expected outputs from main. * Move tokenizer expected outputs. * Sync with latest acoustic tokenizer. * Nits * Address tests * import diffusers differently * Nits and cleanup. * More clean up after going through examples. * Processor docstring. * Update generation usage with latest merge. * Update with latest config and repo conventions. * Fix csm * Remove VibeVoiceSemanticTokenizerConfig from docs. * style checks and go through doc examples * Better modular * Apply suggestion from @vasqu Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com> * Address doc comments. * Address conversion script comment. * Apply suggestions from code review Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com> * Better api for noise scheduler and monitor_progress * Address rest of generate comments. * Address rest of comments. * Update generate to be torch compile compatible, and other modeling nits. * Address loss and generation comments. * Sub-config for diffusion head. * Better comment and docstring. * Address comments: overwrite generate methods, cleaner tests, and more. * Satisfy style checks. * Style/doc checks. * Fix feature extractor tests. * Use dummy noise scheduler for non integration tests. * Simpler noise scheduler for tests. * Skip incompatible test. * Rename to conversation in docs. * Update src/transformers/models/vibevoice/modular_vibevoice.py Co-authored-by: eustlb <94853470+eustlb@users.noreply.github.com> * Update src/transformers/models/vibevoice/modular_vibevoice.py Co-authored-by: eustlb <94853470+eustlb@users.noreply.github.com> * Update src/transformers/models/vibevoice/modular_vibevoice.py Co-authored-by: eustlb <94853470+eustlb@users.noreply.github.com> * Address modular comments. * Update chat template to handle training regime * Functional approach for weightless rms norm. * Add trf-ignore * Update docs. * Switch to requires_backend * Address style conventions after merge. * update _prepare_static_cache with latest change * skip exports * Update model id. --------- Co-authored-by: Eric B <ebezzam@gmail.com> Co-authored-by: Eric Bezzam <4757445+ebezzam@users.noreply.github.com> Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com> Co-authored-by: eustlb <94853470+eustlb@users.noreply.github.com>
Author
Parents
Loading