Merge pull request #2001 from cheahjs/feat/limit-title-gen-tokens

feat: restrict title gen output to 50 tokens
This commit is contained in:
Timothy Jaeryang Baek 2024-05-06 00:05:53 -07:00 committed by GitHub
commit 0334ab7c5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -159,7 +159,11 @@ export const generateTitle = async (
body: JSON.stringify({
model: model,
prompt: template,
stream: false
stream: false,
options: {
// Restrict the number of tokens generated to 50
num_predict: 50,
}
})
})
.then(async (res) => {

View File

@ -295,7 +295,9 @@ export const generateTitle = async (
content: template
}
],
stream: false
stream: false,
// Restricting the max tokens to 50 to avoid long titles
max_tokens: 50,
})
})
.then(async (res) => {