Skip to content

Commit

Permalink
use the new GPT-4-turbo
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdallas committed Nov 10, 2023
1 parent e28a9b9 commit 95f469a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use anyhow::Result;
use crate::util::Summary;

const OPENAI_API_URL: &str = "https://api.openai.com/v1/chat/completions";
const OPENAI_MODEL: &str = "gpt-3.5-turbo";
const OPENAI_MODEL: &str = "gpt-4-1106-preview";


#[derive(Serialize, Deserialize, Debug, Clone)]
Expand Down
4 changes: 2 additions & 2 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub async fn split_file(path: PathBuf, tmp_dir: &TempDir) -> Result<Vec<Segment>
.stderr(Stdio::null())
.spawn()?;

let status = command.wait().await?;
let _status = command.wait().await?;


let mut filenames: Vec<PathBuf> = tmp_dir.path().read_dir()?.map(|entry| {
Expand All @@ -50,7 +50,7 @@ pub struct Summary {
}


const WORDS_PER_CHUNK: usize = 2500;
const WORDS_PER_CHUNK: usize = 2500 * 16; // 8k tokens is around 2500 words. The new GPT-4-turbo model has a 128k context

pub fn split_text_to_chunks(text: String) -> Vec<Summary> {
let mut chunks = Vec::new();
Expand Down

0 comments on commit 95f469a

Please sign in to comment.