mihalykiss commited on
Commit
e09232a
Β·
1 Parent(s): 07a415d

UI - theme

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -25,6 +25,8 @@ label_mapping = {
25
  }
26
 
27
  def classify_text(text):
 
 
28
  inputs = tokenizer(text, return_tensors="pt", truncation=True)
29
  inputs = {key: value.to(device) for key, value in inputs.items()}
30
 
@@ -52,7 +54,7 @@ description = """
52
 
53
  ---
54
 
55
- Detect AI-generated texts with precision using the new **ModernBERT** model, fine-tuned for machine-generated text detection which capable of identifying 40 different models.
56
 
57
  - πŸ€– - **Identify AI Models:** Reveals which LLM generated the text if detected as AI.
58
  - βœ… - **Human Verification:** Marks human-written text with a green checkmark.
 
25
  }
26
 
27
  def classify_text(text):
28
+ if not text.strip():
29
+ return "----"
30
  inputs = tokenizer(text, return_tensors="pt", truncation=True)
31
  inputs = {key: value.to(device) for key, value in inputs.items()}
32
 
 
54
 
55
  ---
56
 
57
+ Detect AI-generated texts with precision using the new **ModernBERT** model, fine-tuned for machine-generated text detection which is capable of identifying 40 different models.
58
 
59
  - πŸ€– - **Identify AI Models:** Reveals which LLM generated the text if detected as AI.
60
  - βœ… - **Human Verification:** Marks human-written text with a green checkmark.