summaryrefslogtreecommitdiff
path: root/candle-examples/examples/whisper/main.rs
diff options
context:
space:
mode:
authorLaurent Mazare <laurent.mazare@gmail.com>2023-11-02 19:32:35 +0100
committerGitHub <noreply@github.com>2023-11-02 19:32:35 +0100
commite08fbb654370ab465f01ba79f9f7b533cff03d15 (patch)
tree86632f1463fa8cbe196985264fb4453687eb2949 /candle-examples/examples/whisper/main.rs
parentd39d0c40fd27048cd8641d84f3e1da8b685302dd (diff)
downloadcandle-e08fbb654370ab465f01ba79f9f7b533cff03d15.tar.gz
candle-e08fbb654370ab465f01ba79f9f7b533cff03d15.tar.bz2
candle-e08fbb654370ab465f01ba79f9f7b533cff03d15.zip
Add support for distil whisper (#1245)
* Add support for distil-whisper. * Add distil-large. * Rename the large model.
Diffstat (limited to 'candle-examples/examples/whisper/main.rs')
-rw-r--r--candle-examples/examples/whisper/main.rs18
1 files changed, 15 insertions, 3 deletions
diff --git a/candle-examples/examples/whisper/main.rs b/candle-examples/examples/whisper/main.rs
index 07247451..4007bd8d 100644
--- a/candle-examples/examples/whisper/main.rs
+++ b/candle-examples/examples/whisper/main.rs
@@ -361,15 +361,25 @@ enum WhichModel {
MediumEn,
Large,
LargeV2,
+ #[value(name = "distil-medium.en")]
+ DistilMediumEn,
+ #[value(name = "distil-large-v2")]
+ DistilLargeV2,
}
impl WhichModel {
fn is_multilingual(&self) -> bool {
match self {
- Self::Tiny | Self::Base | Self::Small | Self::Medium | Self::Large | Self::LargeV2 => {
- true
+ Self::Tiny
+ | Self::Base
+ | Self::Small
+ | Self::Medium
+ | Self::Large
+ | Self::LargeV2
+ | Self::DistilLargeV2 => true,
+ Self::TinyEn | Self::BaseEn | Self::SmallEn | Self::MediumEn | Self::DistilMediumEn => {
+ false
}
- Self::TinyEn | Self::BaseEn | Self::SmallEn | Self::MediumEn => false,
}
}
@@ -385,6 +395,8 @@ impl WhichModel {
Self::MediumEn => ("openai/whisper-medium.en", "main"),
Self::Large => ("openai/whisper-large", "refs/pr/36"),
Self::LargeV2 => ("openai/whisper-large-v2", "refs/pr/57"),
+ Self::DistilMediumEn => ("distil-whisper/distil-medium.en", "main"),
+ Self::DistilLargeV2 => ("distil-whisper/distil-large-v2", "main"),
}
}
}