revert changes in qwen 3 tts
Signed-off-by: tzhouam <tzhouam@connect.ust.hk>
This commit is contained in:
1 parent
3c52432100
commit
0d23f68997
1 file changed
+13
-9
@@ -116,12 +116,18 @@ def talker2code2wav_async_chunk(
|
||||
initial_chunk_size = int(entry.list_data[0])
|
||||
per_request_override = True
|
||||
|
||||
# Dynamic IC: recalculate each call so IC adapts to current load.
|
||||
# Dynamic IC: cache per request so boundaries stay stable for its lifetime.
|
||||
if not per_request_override:
|
||||
max_ic = max_ic_for_chunk_size(chunk_size)
|
||||
active = sum(1 for v in transfer_manager.code_prompt_token_ids.values() if len(v) > 0)
|
||||
capacity = getattr(transfer_manager, "scheduler_max_num_seqs", 1)
|
||||
initial_chunk_size = compute_dynamic_initial_chunk_size(active, capacity, max_ic)
|
||||
_ic_cache = getattr(transfer_manager, "_cached_ic", None)
|
||||
if _ic_cache is None:
|
||||
_ic_cache = {}
|
||||
transfer_manager._cached_ic = _ic_cache
|
||||
if request_id not in _ic_cache:
|
||||
max_ic = max_ic_for_chunk_size(chunk_size)
|
||||
active = sum(1 for v in transfer_manager.code_prompt_token_ids.values() if len(v) > 0)
|
||||
capacity = getattr(transfer_manager, "scheduler_max_num_seqs", 1)
|
||||
_ic_cache[request_id] = compute_dynamic_initial_chunk_size(active, capacity, max_ic)
|
||||
initial_chunk_size = _ic_cache[request_id]
|
||||
|
||||
if chunk_size <= 0 or left_context_size_config < 0 or initial_chunk_size < 0:
|
||||
raise ValueError(
|
||||
@@ -139,13 +145,11 @@ def talker2code2wav_async_chunk(
|
||||
initial_chunk_size = chunk_size
|
||||
length = len(transfer_manager.code_prompt_token_ids[request_id])
|
||||
|
||||
finished_tensor = torch.tensor(finished, dtype=torch.bool)
|
||||
|
||||
if length <= 0:
|
||||
if finished:
|
||||
return {
|
||||
"code_predictor_codes": [],
|
||||
"finished": finished_tensor,
|
||||
"finished": True,
|
||||
}
|
||||
return None
|
||||
|
||||
@@ -193,5 +197,5 @@ def talker2code2wav_async_chunk(
|
||||
return {
|
||||
"code_predictor_codes": code_predictor_codes,
|
||||
"left_context_size": left_context_size,
|
||||
"finished": finished_tensor,
|
||||
"finished": finished,
|
||||
}
|
||||
Reference in new issue
Block a user