FEATURE: Allow using large context OpenAI models for summarization (#86)

This commit is contained in:
Rafael dos Santos Silva 2023-06-13 15:23:48 -03:00 committed by GitHub
parent 3364fec425
commit 8742535024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -12,7 +12,9 @@ module DiscourseAi
def inject_into(plugin)
[
Strategies::OpenAi.new("gpt-4"),
Strategies::OpenAi.new("gpt-4-32k"),
Strategies::OpenAi.new("gpt-3.5-turbo"),
Strategies::OpenAi.new("gpt-3.5-turbo-16k"),
Strategies::DiscourseAi.new("bart-large-cnn-samsum"),
Strategies::DiscourseAi.new("flan-t5-base-samsum"),
Strategies::DiscourseAi.new("long-t5-tglobal-base-16384-book-summary"),

View File

@ -41,7 +41,12 @@ module DiscourseAi
private
def max_length
lengths = { "gpt-3.5-turbo" => 4096, "gpt-4" => 8192 }
lengths = {
"gpt-3.5-turbo" => 4096,
"gpt-4" => 8192,
"gpt-3.5-turbo-16k" => 16_384,
"gpt-4-32k" => 32_768,
}
lengths[model]
end