community: Add keep_alive parameter to control how long the model w… (#19005)

Add `keep_alive` parameter to control how long the model will stay
loaded into memory with Ollama。

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
gonvee
2024-03-19 12:29:01 +08:00
committed by GitHub
parent bb0dd8f82f
commit b82644078e
2 changed files with 17 additions and 1 deletions

View File

@@ -100,6 +100,7 @@ def test_handle_kwargs_top_level_parameters(monkeypatch: MonkeyPatch) -> None:
"prompt": "Test prompt",
"system": "Test system prompt",
"template": None,
"keep_alive": None,
}
assert stream is True
assert timeout == 300
@@ -147,6 +148,7 @@ def test_handle_kwargs_with_unknown_param(monkeypatch: MonkeyPatch) -> None:
"prompt": "Test prompt",
"system": None,
"template": None,
"keep_alive": None,
}
assert stream is True
assert timeout == 300
@@ -178,6 +180,7 @@ def test_handle_kwargs_with_options(monkeypatch: MonkeyPatch) -> None:
"prompt": "Test prompt",
"system": None,
"template": None,
"keep_alive": None,
}
assert stream is True
assert timeout == 300