mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-09 11:24:53 +00:00
black
This commit is contained in:
parent
db187caf6b
commit
8834aaf46d
@ -43,7 +43,10 @@ async def test_grammar_response_format_llama_json(llama_grammar, response_snapsh
|
||||
],
|
||||
"seed": 42,
|
||||
"max_tokens": 500,
|
||||
"response_format": {"type": "json_object", "value": Weather.model_json_schema()},
|
||||
"response_format": {
|
||||
"type": "json_object",
|
||||
"value": Weather.model_json_schema(),
|
||||
},
|
||||
}
|
||||
# send the request
|
||||
response = requests.post(
|
||||
@ -75,7 +78,11 @@ async def test_grammar_response_format_llama_json(llama_grammar, response_snapsh
|
||||
|
||||
json_payload["response_format"] = {
|
||||
"type": "json_schema",
|
||||
"value": {"name": "weather", "strict": True, "schema": Weather.model_json_schema()},
|
||||
"value": {
|
||||
"name": "weather",
|
||||
"strict": True,
|
||||
"schema": Weather.model_json_schema(),
|
||||
},
|
||||
}
|
||||
response = requests.post(
|
||||
f"{llama_grammar.base_url}/v1/chat/completions",
|
||||
@ -119,7 +126,10 @@ async def test_grammar_response_format_llama_error_if_tools_not_installed(
|
||||
"seed": 42,
|
||||
"max_tokens": 500,
|
||||
"tools": [],
|
||||
"response_format": {"type": "json_object", "value": Weather.model_json_schema()},
|
||||
"response_format": {
|
||||
"type": "json_object",
|
||||
"value": Weather.model_json_schema(),
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
|
@ -9,7 +9,7 @@ import numpy as np
|
||||
|
||||
|
||||
def find_segments(
|
||||
adapter_indices: Union[torch.Tensor, List[int]]
|
||||
adapter_indices: Union[torch.Tensor, List[int]],
|
||||
) -> Tuple[List[int], List[int]]:
|
||||
if isinstance(adapter_indices, torch.Tensor):
|
||||
adapter_indices = adapter_indices.cpu().numpy()
|
||||
|
Loading…
Reference in New Issue
Block a user