From dc3dd120c8a68ed9b25509aebe1a1190a2aab838 Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Tue, 5 Sep 2023 20:02:11 -0700 Subject: [PATCH] Improve doc (#2371) --- docs/commands/test_process.md | 3 +++ tests/launch_openai_api_test_server.py | 2 +- tests/test_cli.py | 5 ++--- tests/test_openai_api.py | 10 +++++----- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/commands/test_process.md b/docs/commands/test_process.md index 642ffaa02..804717556 100644 --- a/docs/commands/test_process.md +++ b/docs/commands/test_process.md @@ -1,3 +1,6 @@ +## Unit tests for FastChat +The scripts are under [FastChat/tests](../../tests). + ### Test CLI Inference ``` diff --git a/tests/launch_openai_api_test_server.py b/tests/launch_openai_api_test_server.py index ae21869a2..a58570fd6 100644 --- a/tests/launch_openai_api_test_server.py +++ b/tests/launch_openai_api_test_server.py @@ -13,7 +13,7 @@ def launch_process(cmd): launch_process("python3 -m fastchat.serve.openai_api_server") models = [ - "lmsys/vicuna-7b-v1.3", + "lmsys/vicuna-7b-v1.5", "lmsys/fastchat-t5-3b-v1.0", "THUDM/chatglm-6b", "mosaicml/mpt-7b-chat", diff --git a/tests/test_cli.py b/tests/test_cli.py index 4b8dbcc19..dcefa4bbe 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -7,14 +7,13 @@ def test_single_gpu(): models = [ - "lmsys/vicuna-7b-v1.3", + "lmsys/vicuna-7b-v1.5", "lmsys/longchat-7b-16k", "lmsys/fastchat-t5-3b-v1.0", + "meta-llama/Llama-2-7b-chat-hf", "THUDM/chatglm-6b", "THUDM/chatglm2-6b", "mosaicml/mpt-7b-chat", - "project-baize/baize-v2-7b", - "h2oai/h2ogpt-gm-oasst1-en-2048-open-llama-7b", "tiiuae/falcon-7b-instruct", "~/model_weights/alpaca-7b", "~/model_weights/RWKV-4-Raven-7B-v11x-Eng99%-Other1%-20230429-ctx8192.pth", diff --git a/tests/test_openai_api.py b/tests/test_openai_api.py index 87e8af4ec..f291b90a3 100644 --- a/tests/test_openai_api.py +++ b/tests/test_openai_api.py @@ -59,7 +59,7 @@ def test_chat_completion_stream(model): print() -def test_openai_curl(model): +def test_openai_curl(): run_cmd("curl http://localhost:8000/v1/models") run_cmd( @@ -67,7 +67,7 @@ def test_openai_curl(model): curl http://localhost:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ - "model": "vicuna-7b-v1.3", + "model": "vicuna-7b-v1.5", "messages": [{"role": "user", "content": "Hello! What is your name?"}] }' """ @@ -78,7 +78,7 @@ def test_openai_curl(model): curl http://localhost:8000/v1/completions \ -H "Content-Type: application/json" \ -d '{ - "model": "vicuna-7b-v1.3", + "model": "vicuna-7b-v1.5", "prompt": "Once upon a time", "max_tokens": 41, "temperature": 0.5 @@ -91,7 +91,7 @@ def test_openai_curl(model): curl http://localhost:8000/v1/embeddings \ -H "Content-Type: application/json" \ -d '{ - "model": "vicuna-7b-v1.3", + "model": "vicuna-7b-v1.5", "input": "Hello world!" }' """ @@ -111,4 +111,4 @@ def test_openai_curl(model): test_chat_completion_stream(model) print("===== Test curl =====") - test_openai_curl("vicuna-7b-v1.3") + test_openai_curl()