mirror of
https://github.com/mudler/LocalAI.git
synced 2026-10-30 01:58:45 -04:00
chore: ⬆️ Update 0xShug0/audio.cpp to 96269554d00621fb0fca6b52b58919749eba1c8d (#12598)
* ⬆️ Update 0xShug0/audio.cpp Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(audio-cpp): map new detection tasks Upstream adds wake-word and audio-classification task kinds. Preserve their capability names without routing them to unrelated audio RPCs. Assisted-by: Codex:gpt-6 --------- Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mudler <2420543+mudler@users.noreply.github.com> Co-authored-by: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com>
This commit is contained in:
6 files changed
+39
-3
No files matched your search
@@ -362,7 +362,7 @@ static void test_names_round_trip() {
|
||||
Task::VoiceCloning, Task::VoiceConversion,
|
||||
Task::SpeechToSpeech, Task::Alignment, Task::VoiceDesign,
|
||||
Task::SpeakerRecognition, Task::Svc, Task::Midi,
|
||||
Task::TurnDetection};
|
||||
Task::TurnDetection, Task::WakeWord, Task::AudioClassification};
|
||||
for (const Task t : all) {
|
||||
Task parsed = Task::Vad;
|
||||
const bool ok = parse_task_name(task_name(t), parsed);
|
||||
@@ -588,7 +588,27 @@ static void test_turn_detection_is_not_vad() {
|
||||
"turn detection has an accurate capability diagnostic");
|
||||
}
|
||||
|
||||
static void test_detection_tasks_are_not_existing_rpcs() {
|
||||
for (const auto *name : {"wake", "cls"}) {
|
||||
Task task = Task::Vad;
|
||||
check(parse_task_name(name, task), "upstream detection task parses");
|
||||
check(std::string(task_name(task)) == name, "detection task name round-trips");
|
||||
Capabilities caps{"detector", {{task, {Mode::Offline}}}};
|
||||
for (const auto rpc : {Rpc::Tts, Rpc::TtsStream, Rpc::AudioTranscription,
|
||||
Rpc::AudioTranscriptionStream, Rpc::AudioTranscriptionLive,
|
||||
Rpc::Vad, Rpc::Diarize, Rpc::SoundGeneration, Rpc::AudioTransform}) {
|
||||
check(!resolve_route(rpc, RequestShape{}, caps).ok,
|
||||
"detection tasks cannot serve an existing RPC");
|
||||
RequestShape pinned;
|
||||
pinned.pinned_task = name;
|
||||
check(!resolve_route(rpc, pinned, caps).ok,
|
||||
"pinning detection tasks cannot bypass RPC admission");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
test_detection_tasks_are_not_existing_rpcs();
|
||||
test_turn_detection_is_not_vad();
|
||||
test_plain_tts();
|
||||
test_tts_with_voice_reference_prefers_cloning();
|
||||
|
||||
Reference in new issue
Block a user