Signed-off-by: chickeyton <ngton2014@gmail.com> Signed-off-by: Yueqian Lin <linyueqian@outlook.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: Yueqian Lin <linyueqian@outlook.com>
28 lines
869 B
Python
28 lines
869 B
Python
# SPDX-License-Identifier: Apache-2.0
|
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
|
"""PCM input framing for PersonaPlex: 24 kHz ``pcm_f32le`` into 1920-sample (80 ms) units."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from vllm_omni.model_executor.common.duplex.pcm_buffer import FixedFramePcmAppendBuffer
|
|
from vllm_omni.model_executor.models.personaplex.duplex.config import (
|
|
CHUNK_PERIOD_MS,
|
|
FRAME_SIZE,
|
|
SAMPLE_RATE,
|
|
)
|
|
|
|
|
|
class PersonaPlexPcmAppendBuffer(FixedFramePcmAppendBuffer):
|
|
"""Transactionally frame 24 kHz float PCM into PersonaPlex 80 ms units."""
|
|
|
|
def __init__(self) -> None:
|
|
super().__init__(
|
|
sample_rate_hz=SAMPLE_RATE,
|
|
frame_samples=FRAME_SIZE,
|
|
chunk_period_ms=CHUNK_PERIOD_MS,
|
|
model="PersonaPlex",
|
|
)
|
|
|
|
|
|
__all__ = ["PersonaPlexPcmAppendBuffer"]
|