mirror of
https://github.com/ggerganov/llama.cpp
synced 2026-03-04 14:19:19 +01:00
* server : add Anthropic Messages API support * remove -@pytest.mark.slow from tool calling/jinja tests * server : remove unused code and slow/skip on test_anthropic_vision_base64_with_multimodal_model in test_anthropic_api.py * server : removed redundant n field logic in anthropic_params_from_json * server : use single error object instead of error_array in streaming response handler for /v1/chat/completions and use unordered_set instead of set in to_json_anthropic_stream() * server : refactor Anthropic API to use OAI conversion * make sure basic test always go first * clean up * clean up api key check, add test --------- Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
22 lines
608 B
Python
22 lines
608 B
Python
import pytest
|
|
from utils import *
|
|
|
|
|
|
# ref: https://stackoverflow.com/questions/22627659/run-code-before-and-after-each-test-in-py-test
|
|
@pytest.fixture(autouse=True)
|
|
def stop_server_after_each_test():
|
|
# do nothing before each test
|
|
yield
|
|
# stop all servers after each test
|
|
instances = set(
|
|
server_instances
|
|
) # copy the set to prevent 'Set changed size during iteration'
|
|
for server in instances:
|
|
server.stop()
|
|
|
|
|
|
@pytest.fixture(scope="module", autouse=True)
|
|
def do_something():
|
|
# this will be run once per test session, before any tests
|
|
ServerPreset.load_all()
|