[GLM4.6v] Required changes for bumping up to transformer 5.x (#13229)

This commit is contained in:
Binyao Jiang
2025-11-17 18:58:00 -08:00
committed by GitHub
parent d7984f3125
commit 90c18a16cb
11 changed files with 29 additions and 26 deletions

View File

@@ -995,7 +995,10 @@ async def get_mooncake_request_over_time(
# Form the full prompt from history
try:
full_prompt_text = tokenizer.apply_chat_template(
chat_history, tokenize=False, add_generation_prompt=True
chat_history,
tokenize=False,
add_generation_prompt=True,
return_dict=False,
)
except Exception:
full_prompt_text = "\n".join(
@@ -1161,6 +1164,7 @@ def sample_sharegpt_requests(
[{"role": "user", "content": prompt}],
add_generation_prompt=True,
tokenize=False,
return_dict=False,
)
if tokenizer.bos_token:
prompt = prompt.replace(tokenizer.bos_token, "")