Allow Ollama Model KeepAlive to be None, defaulting to indefinite (#13059)
Putting this back to `Option<KeepAlive>` to make existing configs keep working. Release Notes: - N/A
This commit is contained in:
parent
b03653321f
commit
53f702c92f
2 changed files with 3 additions and 3 deletions
|
@ -240,7 +240,7 @@ impl OllamaCompletionProvider {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
keep_alive: model.keep_alive,
|
keep_alive: model.keep_alive.unwrap_or_default(),
|
||||||
stream: true,
|
stream: true,
|
||||||
options: Some(ChatOptions {
|
options: Some(ChatOptions {
|
||||||
num_ctx: Some(model.max_tokens),
|
num_ctx: Some(model.max_tokens),
|
||||||
|
|
|
@ -66,7 +66,7 @@ impl Default for KeepAlive {
|
||||||
pub struct Model {
|
pub struct Model {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub max_tokens: usize,
|
pub max_tokens: usize,
|
||||||
pub keep_alive: KeepAlive,
|
pub keep_alive: Option<KeepAlive>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Model {
|
impl Model {
|
||||||
|
@ -74,7 +74,7 @@ impl Model {
|
||||||
Self {
|
Self {
|
||||||
name: name.to_owned(),
|
name: name.to_owned(),
|
||||||
max_tokens: 2048,
|
max_tokens: 2048,
|
||||||
keep_alive: KeepAlive::indefinite(),
|
keep_alive: Some(KeepAlive::indefinite()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue