sync update from LAN repo (source dhk-1 @ 3e87be55)

This commit is contained in:
gozeros committed 2026-10-21 15:06:08 +08:00
1 parent ab6068a7c1
commit 42f2a26fa8
1482 files changed
+227759 -9584

No files matched your search

@@ -234,12 +234,23 @@ async def test_fixed_answer_default_speed_schedules_100_tokens_per_second(
async for generation in model._astream([]):
chunks.append(str(generation.message.content))
token_count = len(fixed_answer_module._TOKEN_ENCODING.encode(answer))
token_count = len(fixed_answer_module._split_local_tokens(answer))
assert "".join(chunks) == answer
assert model.tokens_per_second == 100
assert sum(sleeps) == pytest.approx((token_count - 1) / 100)
def test_fixed_answer_local_tokenizer_is_lossless_and_offline() -> None:
answer = " 离线环境\nEnglish words, 数字 123,emoji 👋🏽。 "
tokens = fixed_answer_module._split_local_tokens(answer)
assert "".join(tokens) == answer
assert len(tokens) > 1
assert len(fixed_answer_module._split_local_tokens("x" * 50)) >= 13
assert "tiktoken" not in fixed_answer_module.__dict__
def test_replace_request_rejects_duplicate_exact_questions() -> None:
row = {
"question": "重复问题",