feat(voice): implement local S2S retained history and provider selection
Add pinned CPU engine dependencies, retained interrupted-response history, provider admission, offline evaluation and isolated browser tooling. Record Phase 2 acceptance and Phase 3/4 preparation, bounded paid-test accounting and interruption incident findings. Human interruption acceptance, paired OpenAI evaluation and rollback remain pending.
This commit is contained in:
@@ -13,6 +13,7 @@ def build_runtime(config, stop):
|
||||
from speech_to_speech.config import load_config, resolve_config
|
||||
from speech_to_speech.configured_runtime import build_configured_server
|
||||
from speech_to_speech.api.openai_realtime.handlers.session import SessionHandler
|
||||
from speech_to_speech.pipeline.language_detection import warm_language_detector
|
||||
import speech_to_speech.s2s_pipeline as pipeline
|
||||
import speech_to_speech.LLM.base_openai_compatible_language_model as base_llm
|
||||
import speech_to_speech.api.openai_realtime.server as server_module
|
||||
@@ -25,10 +26,21 @@ def build_runtime(config, stop):
|
||||
kwargs['source'] = 'local'
|
||||
return native_load(str(source), *args, **kwargs)
|
||||
torch.hub.load = local_vad
|
||||
pipeline.Queue = lambda *args, **kwargs: FailClosedQueue(stop)
|
||||
class PipelineQueue(FailClosedQueue):
|
||||
# Upstream uses Queue both as a constructor and in Queue[Any] annotations.
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(stop)
|
||||
pipeline.Queue = PipelineQueue
|
||||
# Base setup invokes warmup from inside construction; install before it runs.
|
||||
install_client_policy(base_llm, config)
|
||||
# The pinned output processor also detects language for fixed session configs.
|
||||
# Its first lazy Lingua preload can hold the GIL beyond the media send deadline.
|
||||
# Prime the same cache before exposing the listener, within the startup budget.
|
||||
warm_language_detector()
|
||||
resolved = resolve_config(load_config(Path(__file__).with_name('pipeline.yaml')), names=['local'])
|
||||
if config.local_s2s_retain_interrupted_answers:
|
||||
from services.local_s2s.history import install_retained_history
|
||||
install_retained_history()
|
||||
runtime = build_configured_server(resolved, stop)
|
||||
try:
|
||||
units = runtime.server.pool
|
||||
|
||||
Reference in New Issue
Block a user