refactoring
different default system prompts for cli and audio
This commit is contained in:
+6
-2
@@ -1,4 +1,4 @@
|
||||
use crate::config::OllamaModelConfig;
|
||||
use crate::config::{HumanInterface, OllamaModelConfig};
|
||||
use crate::tlt;
|
||||
use crate::translate;
|
||||
use ollama_rs::Ollama;
|
||||
@@ -9,6 +9,7 @@ use ollama_rs::models::create::{CreateModelRequest, CreateModelStatus};
|
||||
pub async fn create_model_from_config(
|
||||
ollama: &Ollama,
|
||||
config: &OllamaModelConfig,
|
||||
interface: &HumanInterface
|
||||
) -> Result<CreateModelStatus, OllamaError> {
|
||||
let model_options = ModelOptions::default()
|
||||
.num_ctx(config.context_size.unwrap_or(2048)) // 2048 is the ollama default.
|
||||
@@ -17,7 +18,10 @@ pub async fn create_model_from_config(
|
||||
let system_prompt = config
|
||||
.system_prompt
|
||||
.clone()
|
||||
.unwrap_or(tlt!("system_prompt"));
|
||||
.unwrap_or(match interface {
|
||||
HumanInterface::Cli => tlt!("system_prompt_cli"),
|
||||
HumanInterface::Audio => tlt!("system_prompt_audio"),
|
||||
});
|
||||
|
||||
// print message to warn user of long waiting times
|
||||
if let Ok(models) = ollama.list_local_models().await
|
||||
|
||||
Reference in New Issue
Block a user