[Core] Support multiple tasks per model (#20771)

Signed-off-by: NickLucche <nlucches@redhat.com>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Nicolò Lucchesi
2025-07-12 19:40:11 -07:00
committed by GitHub
co-authored by DarkLight1337
parent c1acd6d7d4
commit 020f58abcd
8 changed files with 279 additions and 148 deletions
+3
View File
@@ -772,6 +772,9 @@ class WhisperForConditionalGeneration(nn.Module, SupportsTranscription,
".fc2.": ".mlp.fc2."
})
# Whisper only supports audio-conditioned generation.
supports_transcription_only = True
@classmethod
def validate_language(cls, language: str) -> bool:
if language in ISO639_1_SUPPORTED_LANGS: