Skip to content

Commit

Permalink
params fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nvrxq committed Dec 22, 2024
1 parent 2c60436 commit 0958ee9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/server/tests/unit/test_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ def test_completion_requested_fields(
assert res.status_code == 200
assert "content" in res.body
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["prompt"] == "<s> " + prompt
assert isinstance(res.body["content"], str)
assert len(res.body) == len(requested_fields)
else:
assert len(res.body) > 0
assert len(res.body)
assert "generation_settings" in res.body


Expand Down
2 changes: 1 addition & 1 deletion examples/server/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static json json_get_nested_values(const std::vector<std::string> & paths, const

for (const std::string & path : paths) {
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;
for (const std::string & k : keys) {
if (valid_path && current.is_object() && current.contains(k)) {
Expand Down

0 comments on commit 0958ee9

Please sign in to comment.