Skip to content

Commit

Permalink
Improve doc (#2371)
Browse files Browse the repository at this point in the history
  • Loading branch information
merrymercy committed Sep 6, 2023
1 parent 94f4dd6 commit dc3dd12
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
3 changes: 3 additions & 0 deletions docs/commands/test_process.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Unit tests for FastChat
The scripts are under [FastChat/tests](../../tests).

### Test CLI Inference

```
Expand Down
2 changes: 1 addition & 1 deletion tests/launch_openai_api_test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 2 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions tests/test_openai_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ 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(
"""
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?"}]
}'
"""
Expand All @@ -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
Expand All @@ -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!"
}'
"""
Expand All @@ -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()

0 comments on commit dc3dd12

Please sign in to comment.