mihalykiss commited on
Commit
c04032f
·
verified ·
1 Parent(s): 724a60b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -6,10 +6,14 @@ from tokenizers import normalizers
6
  from tokenizers.normalizers import Sequence, Replace, Strip
7
  from tokenizers import Regex
8
 
9
- device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
10
 
11
- tokenizer = DebertaTokenizer.from_pretrained('microsoft/deberta-base')
12
 
 
 
 
 
13
 
14
  model_2 = DebertaForSequenceClassification.from_pretrained("mihalykiss/best_merged_41_2", num_labels=41)
15
  model_2.to(device).eval()
@@ -92,7 +96,7 @@ title = "AI Text Detector"
92
  description = """
93
 
94
 
95
- This tool uses the <b>ModernBERT</b> model to identify whether a given text was written by a human or generated by artificial intelligence (AI). It works with a soft voting ensemble using <b>three</b> models, combining their outputs to improve the accuracy.
96
  <br>
97
 
98
  <div style="line-height: 1.8;">
 
6
  from tokenizers.normalizers import Sequence, Replace, Strip
7
  from tokenizers import Regex
8
 
9
+ from transformers import DebertaTokenizerFast
10
 
11
+ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
12
 
13
+ tokenizer = DebertaTokenizerFast.from_pretrained(
14
+ "microsoft/deberta-base",
15
+ add_prefix_space=True
16
+ )
17
 
18
  model_2 = DebertaForSequenceClassification.from_pretrained("mihalykiss/best_merged_41_2", num_labels=41)
19
  model_2.to(device).eval()
 
96
  description = """
97
 
98
 
99
+ This tool uses a merged <b>DeBERTa</b> model to identify whether a given text was written by a human or generated by artificial intelligence (AI).
100
  <br>
101
 
102
  <div style="line-height: 1.8;">