enzostvs HF Staff commited on
Commit
e34f025
·
1 Parent(s): 1ac2f5f

reduce score nsfw

Browse files
Files changed (1) hide show
  1. app/api/route.ts +1 -2
app/api/route.ts CHANGED
@@ -50,10 +50,9 @@ export async function POST(
50
 
51
  const isNSFW: any = await checkIfIsNSFW(blob)
52
  if (isNSFW?.error) return Response.json({ status: 500, ok: false, message: isNSFW?.error });
53
-
54
  if (isNSFW?.length) {
55
  const scoreNotSafe = isNSFW?.find((n: { label: string }) => n.label === "no_safe");
56
- if (scoreNotSafe?.score > 0.75) {
57
  return Response.json({ status: 401, ok: false, message: "Image is not safe for work." });
58
  }
59
  }
 
50
 
51
  const isNSFW: any = await checkIfIsNSFW(blob)
52
  if (isNSFW?.error) return Response.json({ status: 500, ok: false, message: isNSFW?.error });
 
53
  if (isNSFW?.length) {
54
  const scoreNotSafe = isNSFW?.find((n: { label: string }) => n.label === "no_safe");
55
+ if (scoreNotSafe?.score > 0.85) {
56
  return Response.json({ status: 401, ok: false, message: "Image is not safe for work." });
57
  }
58
  }