[Feature] Support minicpmv v2.6 (#2785)
Co-authored-by: Chayenne <zhaochen20@outlook.com> Co-authored-by: yizhang2077 <1109276519@qq.com>
This commit is contained in:
@@ -25,7 +25,7 @@ export OPENAI_API_KEY=sk-*****
|
||||
python3 test_openai_backend.py
|
||||
|
||||
# Run a single test
|
||||
python3 -m unittest test_openai_backend.TestOpenAIBackend.test_few_shot_qa
|
||||
python3 -m unittest test_openai_backend.TestOpenAIServer.test_few_shot_qa
|
||||
|
||||
# Run a suite with multiple files
|
||||
python3 run_suite.py --suite per-commit
|
||||
|
||||
@@ -171,7 +171,7 @@ class TestOpenAIVisionServer(unittest.TestCase):
|
||||
text = response.choices[0].message.content
|
||||
assert isinstance(text, str)
|
||||
print(text)
|
||||
assert "man" in text or "cab" in text, text
|
||||
assert "man" in text or "cab" in text or "SUV" in text or "taxi" in text, text
|
||||
assert "logo" in text or '"S"' in text or "SG" in text, text
|
||||
assert response.id
|
||||
assert response.created
|
||||
@@ -444,5 +444,24 @@ class TestMllamaServer(TestOpenAIVisionServer):
|
||||
pass
|
||||
|
||||
|
||||
class TestMinicpmvServer(TestOpenAIVisionServer):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.model = "openbmb/MiniCPM-V-2_6"
|
||||
cls.base_url = DEFAULT_URL_FOR_TEST
|
||||
cls.api_key = "sk-123456"
|
||||
cls.process = popen_launch_server(
|
||||
cls.model,
|
||||
cls.base_url,
|
||||
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
||||
other_args=[
|
||||
"--trust-remote-code",
|
||||
"--chat-template",
|
||||
"minicpmv",
|
||||
],
|
||||
)
|
||||
cls.base_url += "/v1"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user