yasserrmd commited on
Commit
a9a3049
·
verified ·
1 Parent(s): 7f059db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -80,7 +80,7 @@ def check_plagiarism(text):
80
  token_text = tokenizer.decode(token_id.unsqueeze(0))
81
 
82
  # If the token is part of the watermark, use a mean or max threshold on g_val if it's multi-element
83
- if mask.item() and g_val.mean().item() > 0.5: # Use .mean() to get a scalar value
84
  highlighted_text += f"<mark>{token_text}</mark>" # Highlight watermarked content
85
  else:
86
  highlighted_text += token_text
 
80
  token_text = tokenizer.decode(token_id.unsqueeze(0))
81
 
82
  # If the token is part of the watermark, use a mean or max threshold on g_val if it's multi-element
83
+ if mask.item() and g_val.float().mean().item() > 0.5: # Use .mean() to get a scalar value
84
  highlighted_text += f"<mark>{token_text}</mark>" # Highlight watermarked content
85
  else:
86
  highlighted_text += token_text