Skip to content

Commit be26c05

Browse files
committed
refactor: extract MTMDBaseHandler to prepare for TTS support
- Centralize shared configuration, context initialization, capability detection, media loading, and resource cleanup in MTMDBaseHandler. - Keep chat templates, message parsing, and text generation in MTMDChatHandler while preserving existing constructor compatibility. - Reuse common infrastructure for a future MTMDAudioGenerator, avoiding duplicated initialization and media handling across chat and TTS. - Release dependent resources before the mtmd context and ensure context cleanup still runs when a resource callback fails. - Add regression coverage for shared initialization, template compatibility, subclass media loading, and cleanup behavior. Signed-off-by: JamePeng <jame_peng@sina.com>
1 parent d807a65 commit be26c05

2 files changed

Lines changed: 697 additions & 537 deletions

File tree

0 commit comments

Comments
 (0)