[Model] Integrate AURA into Full-Duplex Runtime (#7633)
This commit is contained in:
1 parent
d397a2f547
commit
62b15142bd
77 files changed
+7695
-457
No files matched your search
@@ -20,7 +20,7 @@ from typing import TYPE_CHECKING
|
||||
import pybase64 as base64
|
||||
|
||||
from vllm_omni.engine.duplex.config import DuplexPlaybackCommitPolicy
|
||||
from vllm_omni.engine.duplex.contracts import DuplexFence
|
||||
from vllm_omni.engine.duplex.contracts import DuplexFence, duplex_resource_request_id
|
||||
from vllm_omni.engine.duplex.events import ErrorEvent, OverlapDecision, error_event
|
||||
from vllm_omni.engine.duplex.plugin import payload_turn_id
|
||||
|
||||
@@ -65,6 +65,14 @@ def append_fence(session: DuplexEngineSession, payload: object, *, epoch: int |
|
||||
)
|
||||
|
||||
|
||||
def stage0_request_id(session: DuplexEngineSession, epoch: int) -> str:
|
||||
"""Stable ``stage0`` or ephemeral ``stage0-turn{T}`` request id for Stage0."""
|
||||
fence = DuplexFence(session.session_id, epoch=epoch, turn_id=session.turn_id)
|
||||
if session.capabilities.supports_core_resumable_request:
|
||||
return duplex_resource_request_id(fence, "stage0")
|
||||
return duplex_resource_request_id(fence, f"stage0-turn{fence.turn_id}")
|
||||
|
||||
|
||||
def response_in_progress(session: DuplexEngineSession, tasks: DuplexSessionTasks) -> bool:
|
||||
"""Whether the model still owns the turn.
|
||||
|
||||
@@ -81,6 +89,24 @@ def response_in_progress(session: DuplexEngineSession, tasks: DuplexSessionTasks
|
||||
return tasks.has_response_bound_append_tasks()
|
||||
|
||||
|
||||
def next_commit_allowed(
|
||||
session: DuplexEngineSession,
|
||||
tasks: DuplexSessionTasks,
|
||||
*,
|
||||
concurrent_turn_requests_released: bool,
|
||||
) -> bool:
|
||||
"""Whether a new commit may flush/submit now.
|
||||
|
||||
Idle sessions always allow it. When ``supports_concurrent_turn_requests`` is on and
|
||||
the plugin has released the commit gate, a commit is allowed even though
|
||||
prior assistant TTS/playback still counts as ``response_in_progress``.
|
||||
Barge-in remains the abort path; this gate does not cancel anything.
|
||||
"""
|
||||
if not response_in_progress(session, tasks):
|
||||
return True
|
||||
return session.capabilities.supports_concurrent_turn_requests and concurrent_turn_requests_released
|
||||
|
||||
|
||||
def assistant_playback_active(session: DuplexEngineSession) -> bool:
|
||||
"""Whether the client is still playing audio the session has sent."""
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user