mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-18 01:14:53 +00:00
FIX: Skip embeddings for blank content (#392)
This commit is contained in:
parent
c778592da4
commit
cec9bb8910
@ -108,6 +108,7 @@ module DiscourseAi
|
|||||||
|
|
||||||
def generate_representation_from(target, persist: true)
|
def generate_representation_from(target, persist: true)
|
||||||
text = @strategy.prepare_text_from(target, tokenizer, max_sequence_length - 2)
|
text = @strategy.prepare_text_from(target, tokenizer, max_sequence_length - 2)
|
||||||
|
return if text.blank?
|
||||||
|
|
||||||
new_digest = OpenSSL::Digest::SHA1.hexdigest(text)
|
new_digest = OpenSSL::Digest::SHA1.hexdigest(text)
|
||||||
current_digest = DB.query_single(<<~SQL, target_id: target.id).first
|
current_digest = DB.query_single(<<~SQL, target_id: target.id).first
|
||||||
|
Loading…
x
Reference in New Issue
Block a user