Skip to content

Commit

Permalink
Merge pull request #14 from fco-fbatch/main
Browse files Browse the repository at this point in the history
added phi3.5
  • Loading branch information
andthattoo authored Aug 21, 2024
2 parents 25467d2 + 4b366ff commit d6b2e1e
Show file tree
Hide file tree
Showing 3 changed files with 281 additions and 246 deletions.
11 changes: 11 additions & 0 deletions src/program/atomics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ pub enum Model {
/// [Microsoft's Phi3 Mini model](https://ollama.com/library/phi3:3.8b), 3.8b parameters
#[serde(rename = "phi3:3.8b")]
Phi3Mini,
/// [Microsoft's Phi3.5 Mini model](https://ollama.com/library/phi3.5), 3.8b parameters
#[serde(rename = "phi3.5:3.8b")]
Phi3_5Mini,
/// /// [Microsoft's Phi3.5 Mini model](https://ollama.com/library/phi3.5:3.8b-mini-instruct-fp16), 3.8b parameters
#[serde(rename = "phi3.5:3.8b-mini-instruct-fp16")]
Phi3_5MiniFp16,
/// [Ollama's Llama3.1 model](https://ollama.com/library/llama3.1:latest), 8B parameters
#[serde(rename = "llama3.1:latest")]
Llama3_1_8B,
Expand All @@ -263,6 +269,9 @@ pub enum Model {
#[serde(rename = "gpt-4o-mini")]
GPT4oMini,
}
// phi3.5:3.8b

// phi3.5:3.8b-mini-instruct-fp16

impl From<Model> for String {
fn from(model: Model) -> Self {
Expand Down Expand Up @@ -313,6 +322,8 @@ impl From<Model> for ModelProvider {
Model::Phi3Medium => ModelProvider::Ollama,
Model::Phi3Medium128k => ModelProvider::Ollama,
Model::Phi3Mini => ModelProvider::Ollama,
Model::Phi3_5Mini => ModelProvider::Ollama,
Model::Phi3_5MiniFp16 => ModelProvider::Ollama,
Model::Llama3_1_8B => ModelProvider::Ollama,
Model::GPT3_5Turbo => ModelProvider::OpenAI,
Model::GPT4Turbo => ModelProvider::OpenAI,
Expand Down
24 changes: 24 additions & 0 deletions tests/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,27 @@ async fn test_user_workflow() {
let mut memory = ProgramMemory::new();
exe.execute(None, workflow, &mut memory).await;
}

#[tokio::test]
async fn test_function_call_phi3_5() {
dotenv().ok();
let env = Env::default().filter_or("LOG_LEVEL", "info");
env_logger::Builder::from_env(env).init();
let exe = Executor::new(Model::Phi3_5Mini);
let workflow = Workflow::new_from_json("./tests/test_workflows/search.json").unwrap();
let mut memory = ProgramMemory::new();
let input = Entry::try_value_or_str("How would does reiki work?");
exe.execute(Some(&input), workflow, &mut memory).await;
}

#[tokio::test]
async fn test_function_call_phi3_5_fp16() {
dotenv().ok();
let env = Env::default().filter_or("LOG_LEVEL", "info");
env_logger::Builder::from_env(env).init();
let exe = Executor::new(Model::Phi3_5MiniFp16);
let workflow = Workflow::new_from_json("./tests/test_workflows/search.json").unwrap();
let mut memory = ProgramMemory::new();
let input = Entry::try_value_or_str("How would does reiki work?");
exe.execute(Some(&input), workflow, &mut memory).await;
}
Loading

0 comments on commit d6b2e1e

Please sign in to comment.