接入 LiveKit 与 TurnSense 评分并改进模型曲线选择
This commit is contained in:
@@ -38,13 +38,15 @@ test("curve gaps are not connected and steps remain on the audio clock", () => {
|
||||
|
||||
test("recorded inference exports agree on audio identity and retain all 44 checkpoints", async () => {
|
||||
const files = [
|
||||
["maai", "maai-ch-kyoto"], ["smart_turn", "smart-turn-v3.2"], ["silero_vad", "silero-vad"],
|
||||
["maai", "maai-ch-kyoto"], ["smart_turn", "smart-turn-v3.2"], ["silero_vad", "silero-vad"], ["livekit_mini", "livekit-v1-mini"], ["turnsense", "turnsense-1.0"],
|
||||
] as const;
|
||||
const exports = await Promise.all(files.map(async ([model, directory]) => parseScoreExport(
|
||||
JSON.parse(await readFile(new URL(`../../../experiments/${directory}/results/score-timeline.json`, import.meta.url), "utf8")), model)));
|
||||
const identity = (data: typeof exports[number]) => data.calls.map(call => [call.call_id, call.audio_path, call.audio_sha256, call.duration_ms]);
|
||||
assert.deepEqual(identity(exports[0]), identity(exports[1]));
|
||||
assert.deepEqual(identity(exports[0]), identity(exports[2]));
|
||||
assert.deepEqual(identity(exports[0]), identity(exports[3]));
|
||||
assert.deepEqual(identity(exports[0]), identity(exports[4]));
|
||||
for (const data of exports) {
|
||||
assert.equal(data.calls.reduce((n, call) => n + call.checkpoints.length, 0), 44);
|
||||
for (const call of data.calls) {
|
||||
@@ -69,3 +71,25 @@ test("Silero checkpoints use only the last available frame, and speech is invert
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
test("LiveKit original checkpoints are real exact-time curve scores", async () => {
|
||||
const data = parseScoreExport(JSON.parse(await readFile(new URL(
|
||||
"../../../experiments/livekit-v1-mini/results/score-timeline.json", import.meta.url), "utf8")), "livekit_mini");
|
||||
assert.equal(data.sample_interval_ms, 200);
|
||||
for (const call of data.calls) {
|
||||
for (const [ms, score] of call.checkpoints) {
|
||||
assert.deepEqual(call.points.find(point => point[0] === ms), [ms, score]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
test("TurnSense curve checkpoints retain the complete probability at the exact decision", async () => {
|
||||
const data = parseScoreExport(JSON.parse(await readFile(new URL(
|
||||
"../../../experiments/turnsense-1.0/results/score-timeline.json", import.meta.url), "utf8")), "turnsense");
|
||||
assert.equal(data.sample_interval_ms, 200);
|
||||
for (const call of data.calls) {
|
||||
for (const point of call.checkpoints) assert.deepEqual(call.points.find(p => p[0] === point[0]), point);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user