2023-10-20 19:09:05 +08:00
|
|
|
import sys
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
root_path = Path(__file__).parent.parent.parent
|
|
|
|
|
sys.path.append(str(root_path))
|
|
|
|
|
|
|
|
|
|
from server.model_workers.baichuan import request_baichuan_api
|
|
|
|
|
from pprint import pprint
|
|
|
|
|
|
|
|
|
|
|
2023-10-25 21:32:40 +08:00
|
|
|
def test_baichuan():
|
2023-10-20 19:09:05 +08:00
|
|
|
messages = [{"role": "user", "content": "hello"}]
|
|
|
|
|
|
|
|
|
|
for x in request_baichuan_api(messages):
|
|
|
|
|
print(type(x))
|
|
|
|
|
pprint(x)
|
|
|
|
|
assert x["code"] == 0
|