toxic-debug15

This commit is contained in:
2024-09-26 21:36:14 +03:00
parent a9203fdeaf
commit 8d6daeabe2
2 changed files with 30 additions and 1 deletions

View File

@@ -56,7 +56,7 @@ async def messages_routing(msg, state):
message_id=mid
)
else:
toxic_score = detector(text.lower())
toxic_score = detector(normalize(text))
toxic_perc = math.floor(toxic_score*100)
await redis.set(f"toxic:{cid}", mid)
await redis.set(f"toxic:{cid}:{uid}:{mid}", toxic_perc, ex=60*60*24*3)