mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-06-27 10:02:16 +00:00
FIX: Only send supported image types for classification (#49)
* FIX: Only send supported image types for classification
This commit is contained in:
parent
2cd60a4b3b
commit
89ac5d720a
@ -65,7 +65,11 @@ module DiscourseAi
|
|||||||
end
|
end
|
||||||
|
|
||||||
def content_of(target_to_classify)
|
def content_of(target_to_classify)
|
||||||
target_to_classify.uploads.to_a.select { |u| FileHelper.is_supported_image?(u.url) }
|
target_to_classify
|
||||||
|
.uploads
|
||||||
|
.where(extension: %w[png jpeg jpg PNG JPEG JPG])
|
||||||
|
.to_a
|
||||||
|
.select { |u| FileHelper.is_supported_image?(u.url) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def opennsfw2_verdict?(clasification)
|
def opennsfw2_verdict?(clasification)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user