mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-02-05 08:00:42 +01:00
params fixes
This commit is contained in:
parent
2c6043670e
commit
0958ee96ac
@ -283,13 +283,13 @@ def test_completion_requested_fields(
|
|||||||
assert res.status_code == 200
|
assert res.status_code == 200
|
||||||
assert "content" in res.body
|
assert "content" in res.body
|
||||||
assert len(res.body["content"])
|
assert len(res.body["content"])
|
||||||
if len(requested_fields) > 0:
|
if len(requested_fields):
|
||||||
assert res.body["generation_settings/n_predict"] == n_predict
|
assert res.body["generation_settings/n_predict"] == n_predict
|
||||||
assert res.body["prompt"] == "<s> " + prompt
|
assert res.body["prompt"] == "<s> " + prompt
|
||||||
assert isinstance(res.body["content"], str)
|
assert isinstance(res.body["content"], str)
|
||||||
assert len(res.body) == len(requested_fields)
|
assert len(res.body) == len(requested_fields)
|
||||||
else:
|
else:
|
||||||
assert len(res.body) > 0
|
assert len(res.body)
|
||||||
assert "generation_settings" in res.body
|
assert "generation_settings" in res.body
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ static json json_get_nested_values(const std::vector<std::string> & paths, const
|
|||||||
|
|
||||||
for (const std::string & path : paths) {
|
for (const std::string & path : paths) {
|
||||||
json current = js;
|
json current = js;
|
||||||
const auto keys = string_split<std::string>(path, /*delim*/ '/');
|
const auto keys = string_split<std::string>(path, /*separator*/ '/');
|
||||||
bool valid_path = true;
|
bool valid_path = true;
|
||||||
for (const std::string & k : keys) {
|
for (const std::string & k : keys) {
|
||||||
if (valid_path && current.is_object() && current.contains(k)) {
|
if (valid_path && current.is_object() && current.contains(k)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user