Skip to content

Commit 69d9479

Browse files
committed
fix: [images_engine] LLM do not respect specified case
1 parent c0e61cf commit 69d9479

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bin/lib/images_engine.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,12 @@ def check_is_image_csam(obj_gid, image_description=False):
221221
# TODO LOG
222222
return {"status": "error", "reason": f"ollama requests error: {res.status_code}, {res.text}"}, 400
223223
else:
224-
r = res.json()['response']
224+
r = res.json()['response'].lower()
225225
print(r)
226226
if r:
227-
if 'YES' in r:
227+
if 'yes' in r:
228228
is_csam = True
229-
elif 'NO' in r:
229+
elif 'no' in r:
230230
is_csam = False
231231

232232
# TODO LOG NONE result
@@ -264,7 +264,7 @@ def check_if_domain_csam(domain_id):
264264

265265
if __name__ == '__main__':
266266
# api_get_image_description('')
267-
update_domain_description(Domains.Domain(''), get_default_image_description_model())
267+
# update_domain_description(Domains.Domain(''), get_default_image_description_model())
268268
check_is_image_csam('', image_description=False)
269269
# update_domains_descriptions()
270270
# check_images_csam()

0 commit comments

Comments
 (0)