Add Danish fine-tune catalog entries under a single pending Hugging Face owner constant
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f8ce3120fe
commit
2a4f5b16a5
3 files changed
+120
-1
No files matched your search
+52
-1
@@ -1,5 +1,6 @@
|
||||
import { describe, test, expect } from "bun:test";
|
||||
import {
|
||||
DANISH_MODELS_HF_OWNER,
|
||||
DEFAULT_MODEL_ID,
|
||||
MODELS,
|
||||
WHISPER_LANGUAGES,
|
||||
@@ -32,6 +33,9 @@ describe("MODELS catalog", () => {
|
||||
"onnx-community/whisper-medium.en_timestamped",
|
||||
"onnx-community/whisper-medium-ONNX",
|
||||
"onnx-community/whisper-large-v3-turbo",
|
||||
`${DANISH_MODELS_HF_OWNER}/whisper-small-danish-ONNX`,
|
||||
`${DANISH_MODELS_HF_OWNER}/whisper-large-v3-turbo-danish-ONNX`,
|
||||
`${DANISH_MODELS_HF_OWNER}/edda-v0.2-ONNX`,
|
||||
]);
|
||||
expect(new Set(ids).size).toBe(ids.length);
|
||||
});
|
||||
@@ -70,7 +74,9 @@ describe("MODELS catalog", () => {
|
||||
});
|
||||
|
||||
test("every model maps to a faster-whisper name for the server engine (D-013)", () => {
|
||||
for (const model of MODELS) {
|
||||
// The Danish conversions (D-WS6a) have no faster-whisper alias; their
|
||||
// server-engine name is a Hub repo id — covered by the Danish suite below.
|
||||
for (const model of MODELS.filter((m) => !m.id.startsWith(`${DANISH_MODELS_HF_OWNER}/`))) {
|
||||
// The onnx-community ids and faster-whisper's aliases share the same
|
||||
// size suffix ("tiny.en", …, "large-v3-turbo") once repo-name
|
||||
// decorations ("_timestamped", "-ONNX") are stripped; keeping them
|
||||
@@ -86,6 +92,51 @@ describe("MODELS catalog", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("Danish fine-tune conversions (D-WS6a)", () => {
|
||||
const owner = `${DANISH_MODELS_HF_OWNER}/`;
|
||||
const danish = MODELS.filter((model) => model.id.startsWith(owner));
|
||||
|
||||
test("are published under one owner constant, still a placeholder until the owner confirms", () => {
|
||||
expect(DANISH_MODELS_HF_OWNER).toBe("PENDING-OWNER");
|
||||
expect(danish.map((model) => model.id)).toEqual([
|
||||
`${owner}whisper-small-danish-ONNX`,
|
||||
`${owner}whisper-large-v3-turbo-danish-ONNX`,
|
||||
`${owner}edda-v0.2-ONNX`,
|
||||
]);
|
||||
});
|
||||
|
||||
test("point the server engine at the matching CTranslate2 int8 conversion under the same owner", () => {
|
||||
for (const model of danish) {
|
||||
const ct2 = model.id.replace(/-ONNX$/, "-ct2-int8");
|
||||
expect(model.fasterWhisperModel).toBe(ct2);
|
||||
expect(getFasterWhisperModel(model.id)).toBe(ct2);
|
||||
}
|
||||
});
|
||||
|
||||
test("are multilingual (language/task are sent) and unverified on every device", () => {
|
||||
for (const model of danish) {
|
||||
expect(model.multilingual).toBe(true);
|
||||
for (const device of ["wasm", "webgpu", "webnn"] as const) {
|
||||
expect(model.defaults[device].verified).toBe(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test("share their base model's parameter counts (unchanged architecture)", () => {
|
||||
const small = getModel("onnx-community/whisper-small")!;
|
||||
const turbo = getModel("onnx-community/whisper-large-v3-turbo")!;
|
||||
const [smallDa, turboDa, edda] = danish;
|
||||
for (const [model, base] of [
|
||||
[smallDa!, small],
|
||||
[turboDa!, turbo],
|
||||
[edda!, turbo],
|
||||
] as const) {
|
||||
expect(model.encoderParamsM).toBe(base.encoderParamsM);
|
||||
expect(model.decoderParamsM).toBe(base.decoderParamsM);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolveDefaultDtype", () => {
|
||||
test("WASM defaults: q8 for small models, q4 for large ones", () => {
|
||||
expect(resolveDefaultDtype("onnx-community/whisper-tiny.en", "wasm")).toBe("q8");
|
||||
|
||||
Reference in new issue
Block a user