Register FunAudioChat multimodal plugins with LLaMA-Factory.
()
| 22 | |
| 23 | |
| 24 | def register_mm_plugins() -> None: |
| 25 | """ |
| 26 | Register FunAudioChat multimodal plugins with LLaMA-Factory. |
| 27 | """ |
| 28 | try: |
| 29 | from llamafactory.data.mm_plugin import register_mm_plugin |
| 30 | from .mm_plugins import FunAudioChatPlugin |
| 31 | |
| 32 | # Register FunAudioChat plugin |
| 33 | try: |
| 34 | register_mm_plugin("funaudiochat", FunAudioChatPlugin) |
| 35 | logger.info("Registered MM plugin: funaudiochat") |
| 36 | except ValueError as e: |
| 37 | # Plugin already registered, skip |
| 38 | logger.debug(f"MM plugin funaudiochat already registered: {e}") |
| 39 | |
| 40 | logger.info("Successfully registered FunAudioChat MM plugins") |
| 41 | |
| 42 | except ImportError as e: |
| 43 | logger.error(f"Failed to import mm_plugin modules: {e}") |
| 44 | logger.error("Make sure LLaMA-Factory is installed correctly") |
| 45 | raise |
| 46 | except Exception as e: |
| 47 | logger.error(f"Failed to register MM plugins: {e}") |
| 48 | raise |
| 49 | |
| 50 | |
| 51 | def register_attention_plugin() -> None: |