This commit is contained in:
Rafael dos Santos Silva 2023-03-08 17:52:17 -03:00
parent 4b938efa6e
commit 9e4a007a4a
No known key found for this signature in database
GPG Key ID: 5E50360227B34938
1 changed files with 9 additions and 13 deletions

View File

@ -3,9 +3,8 @@
module DiscourseAI
module Embeddings
class Topic
DISCOURSE_MODELS = %i{all-mpnet-base-v2 msmarco-distilbert-base-v4}
OPENAI_MODELS = %i{text-embedding-ada-002}
DISCOURSE_MODELS = %i[all-mpnet-base-v2 msmarco-distilbert-base-v4]
OPENAI_MODELS = %i[text-embedding-ada-002]
def initialize(topic)
@topic = topic
@ -48,9 +47,7 @@ module DiscourseAI
end
def openai_embeddings
DiscourseAI::Inference::OpenAIEmbeddings.perform!(
@topic.first_post.raw
)
DiscourseAI::Inference::OpenAIEmbeddings.perform!(@topic.first_post.raw)
end
private
@ -58,7 +55,6 @@ module DiscourseAI
def enabled_models
SiteSetting.ai_embeddings_models.split("|").map(&:to_sym)
end
end
end
end