Skip to content

Commit

Permalink
Add cli params for LLM worker
Browse files Browse the repository at this point in the history
Signed-off-by: Milos Gajdos <[email protected]>
  • Loading branch information
milosgajdos committed Apr 15, 2024
1 parent 47a428d commit 8b75b47
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rustbot/src/llm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl Default for Config {
fn default() -> Self {
Config {
hist_size: HISTORY_SIZE,
model_name: MODEL_NAME.to_string(),
model_name: DEFAULT_MODEL_NAME.to_string(),
seed_prompt: None,
}
}
Expand Down
7 changes: 7 additions & 0 deletions rustbot/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ struct Args {
seed_prompt: Option<String>,
#[arg(long)]
boot_prompt: Option<String>,
#[arg(long, default_value_t = 50)]
#[arg(short = 't')]
hist_size: usize,
#[arg(short, long, default_value = DEFAULT_MODEL_NAME)]
model_name: String,
}

#[tokio::main]
Expand All @@ -45,6 +50,8 @@ async fn main() -> Result<()> {
println!("launching {} workers", BOT_NAME);

let c = llm::Config {
hist_size: args.hist_size,
model_name: args.model_name,
seed_prompt: Some(prompt),
..llm::Config::default()
};
Expand Down
2 changes: 1 addition & 1 deletion rustbot/src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error + Send + Sync>>;

pub const HISTORY_SIZE: usize = 50;
pub const MODEL_NAME: &str = "llama2:latest";
pub const DEFAULT_MODEL_NAME: &str = "llama2:latest";
pub const NATS_DEFAULT_URL: &str = "nats://localhost:4222";
pub const STREAM_NAME: &str = "banter";
pub const BOT_NAME: &str = "rustbot";
Expand Down

0 comments on commit 8b75b47

Please sign in to comment.