From 11b05bb5b3556218d7712e2f4a20da222ecc6c4b Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Mon, 11 Sep 2023 23:32:07 +0000 Subject: [PATCH] Release a v0.2.28 with bug fixes and more test cases --- fastchat/__init__.py | 2 +- pyproject.toml | 2 +- tests/launch_openai_api_test_server.py | 22 ++++++++++++++-------- tests/test_openai_api.py | 5 ++++- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/fastchat/__init__.py b/fastchat/__init__.py index be2d7c2ff..968391a2d 100644 --- a/fastchat/__init__.py +++ b/fastchat/__init__.py @@ -1 +1 @@ -__version__ = "0.2.27" +__version__ = "0.2.28" diff --git a/pyproject.toml b/pyproject.toml index 73dbdd8da..1b30b8881 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "fschat" -version = "0.2.27" +version = "0.2.28" description = "An open platform for training, serving, and evaluating large language model based chatbots." readme = "README.md" requires-python = ">=3.8" diff --git a/tests/launch_openai_api_test_server.py b/tests/launch_openai_api_test_server.py index a58570fd6..f555a3882 100644 --- a/tests/launch_openai_api_test_server.py +++ b/tests/launch_openai_api_test_server.py @@ -13,17 +13,23 @@ def launch_process(cmd): launch_process("python3 -m fastchat.serve.openai_api_server") models = [ - "lmsys/vicuna-7b-v1.5", - "lmsys/fastchat-t5-3b-v1.0", - "THUDM/chatglm-6b", - "mosaicml/mpt-7b-chat", + ("lmsys/vicuna-7b-v1.5", "model_worker"), + ("lmsys/fastchat-t5-3b-v1.0", "model_worker"), + ("THUDM/chatglm-6b", "model_worker"), + ("mosaicml/mpt-7b-chat", "model_worker"), + ("meta-llama/Llama-2-7b-chat-hf", "vllm_worker"), ] - for i, model_path in enumerate(models): - launch_process( - f"CUDA_VISIBLE_DEVICES={i} python3 -m fastchat.serve.model_worker " - f"--model-path {model_path} --port {30000+i} --worker http://localhost:{30000+i}" + for i, (model_path, worker_name) in enumerate(models): + cmd = ( + f"CUDA_VISIBLE_DEVICES={i} python3 -m fastchat.serve.{worker_name} " + f"--model-path {model_path} --port {30000+i} " + f"--worker-address http://localhost:{30000+i} " ) + if worker_name == "vllm_worker": + cmd += "--tokenizer hf-internal-testing/llama-tokenizer" + + launch_process(cmd) while True: pass diff --git a/tests/test_openai_api.py b/tests/test_openai_api.py index f291b90a3..d79af8322 100644 --- a/tests/test_openai_api.py +++ b/tests/test_openai_api.py @@ -106,9 +106,12 @@ def test_openai_curl(): print(f"===== Test {model} ======") test_completion(model) test_completion_stream(model) - test_embedding(model) test_chat_completion(model) test_chat_completion_stream(model) + try: + test_embedding(model) + except openai.error.APIError as e: + print(f"Embedding error: {e}") print("===== Test curl =====") test_openai_curl()