Skip to content

Commit 0eca5d5

Browse files
committed
add supported languages to cohere
1 parent 7f13903 commit 0eca5d5

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

src/onnx/cohere/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ const CAPABILITIES: ModelCapabilities = ModelCapabilities {
2626
name: "Cohere",
2727
engine_id: "cohere",
2828
sample_rate: SAMPLE_RATE,
29-
languages: &["en"],
29+
languages: &[
30+
"en", "de", "fr", "it", "es", "pt", "el", "nl", "pl", "ar", "vi", "zh", "ja", "ko",
31+
],
3032
supports_timestamps: false,
3133
supports_translation: false,
3234
supports_streaming: false,

tests/cohere.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,40 @@ fn test_cohere_jfk() {
2828
"Cohere transcription should not be empty"
2929
);
3030
}
31+
32+
#[test]
33+
fn test_cohere_german() {
34+
let model_path = PathBuf::from("models/cohere-int4");
35+
let audio_path = PathBuf::from("samples/german.wav");
36+
37+
if !common::require_paths(&[&model_path, &audio_path]) {
38+
return;
39+
}
40+
41+
let mut model =
42+
CohereModel::load(&model_path, &Quantization::Int4).expect("Failed to load Cohere model");
43+
44+
let result = model
45+
.transcribe_file(
46+
&audio_path,
47+
&transcribe_rs::TranscribeOptions {
48+
language: Some("de".into()),
49+
..Default::default()
50+
},
51+
)
52+
.expect("Failed to transcribe German audio with Cohere model");
53+
54+
println!("German transcription: {}", result.text);
55+
assert!(
56+
!result.text.trim().is_empty(),
57+
"Cohere German transcription should not be empty"
58+
);
59+
60+
// Output should contain German words
61+
let text_lower = result.text.to_lowercase();
62+
assert!(
63+
text_lower.contains("strand") || text_lower.contains("die") || text_lower.contains("der"),
64+
"German transcription should contain German words, got: '{}'",
65+
result.text
66+
);
67+
}

0 commit comments

Comments
 (0)