From fa70d465d4e21340a86b7edbcf44f9969cb622a4 Mon Sep 17 00:00:00 2001 From: Triston Armstrong Date: Tue, 10 Dec 2024 12:12:05 -0500 Subject: [PATCH] Task(dev): Update MindGen to handle new GenOptions fields --- src/mind_bridge.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/mind_bridge.rs b/src/mind_bridge.rs index 234cade..fc253e3 100644 --- a/src/mind_bridge.rs +++ b/src/mind_bridge.rs @@ -1,11 +1,12 @@ use serde::{Deserialize, Serialize}; + // this is a test comment #[derive(Debug, Deserialize)] #[allow(unused)] pub struct GenRes { model: String, created_at: String, - response: String, + pub response: String, done: bool, total_duration: u64, load_duration: u64, @@ -19,6 +20,9 @@ struct GenOptions { temperature: f32, num_predict: u8, + repeat_last_n: u8, + top_k: u8, + top_p: f32 } #[derive(Debug, Serialize)] @@ -33,16 +37,19 @@ impl MindGen { #[allow(unused)] - pub fn new(input: &str) -> Self { + pub fn new(input: String) -> Self { Self { model: String::from("llama3.1"), stream: false, raw: false, - prompt: String::from(input), - system: String::from("You are a commit message generator. You will generate commit messages following this format Task(): making sure to never go over 90 characters"), + prompt: input, + system: String::from("create a short commit message from this diff, with format Task(): . only respond with the commit message"), options: GenOptions { - temperature: 0.5, - num_predict: 90 + temperature: 0.1, + num_predict: 0, + repeat_last_n: 0, + top_k: 10, + top_p: 0.5 } } }