[Feature] support auto chat template (#4949)

This commit is contained in:
woodx
2025-04-29 13:34:18 +08:00
committed by GitHub
parent 5bb0accbcf
commit 2c3ea29476
4 changed files with 112 additions and 31 deletions

View File

@@ -47,11 +47,6 @@ class TestOpenAIVisionServer(CustomTestCase):
cls.base_url,
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
api_key=cls.api_key,
other_args=[
"--chat-template",
"chatml-llava",
# "--log-requests",
],
)
cls.base_url += "/v1"
@@ -475,8 +470,6 @@ class TestQwen2VLServer(TestOpenAIVisionServer):
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
api_key=cls.api_key,
other_args=[
"--chat-template",
"qwen2-vl",
"--mem-fraction-static",
"0.4",
],
@@ -496,8 +489,6 @@ class TestQwen2_5_VLServer(TestOpenAIVisionServer):
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
api_key=cls.api_key,
other_args=[
"--chat-template",
"qwen2-vl",
"--mem-fraction-static",
"0.4",
],
@@ -517,8 +508,6 @@ class TestVLMContextLengthIssue(CustomTestCase):
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
api_key=cls.api_key,
other_args=[
"--chat-template",
"qwen2-vl",
"--context-length",
"300",
"--mem-fraction-static=0.80",
@@ -573,10 +562,6 @@ class TestMllamaServer(TestOpenAIVisionServer):
cls.base_url,
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
api_key=cls.api_key,
other_args=[
"--chat-template",
"llama_3_vision",
],
)
cls.base_url += "/v1"
@@ -596,8 +581,6 @@ class TestMinicpmvServer(TestOpenAIVisionServer):
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
other_args=[
"--trust-remote-code",
"--chat-template",
"minicpmv",
"--mem-fraction-static",
"0.4",
],
@@ -617,8 +600,6 @@ class TestMinicpmoServer(TestOpenAIVisionServer):
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
other_args=[
"--trust-remote-code",
"--chat-template",
"minicpmo",
"--mem-fraction-static",
"0.7",
],
@@ -642,8 +623,6 @@ class TestDeepseekVL2Server(TestOpenAIVisionServer):
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
other_args=[
"--trust-remote-code",
"--chat-template",
"deepseek-vl2",
"--context-length",
"4096",
],
@@ -690,8 +669,6 @@ class TestJanusProServer(TestOpenAIVisionServer):
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
other_args=[
"--trust-remote-code",
"--chat-template",
"janus-pro",
"--mem-fraction-static",
"0.4",
],
@@ -744,8 +721,6 @@ class TestGemma3itServer(TestOpenAIVisionServer):
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
other_args=[
"--trust-remote-code",
"--chat-template",
"gemma-it",
"--mem-fraction-static",
"0.75",
"--enable-multimodal",