aliasgerovs commited on
Commit
d9946cc
1 Parent(s): 3f7f887
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -13,7 +13,9 @@ from scipy.special import softmax
13
  from evaluate import load
14
  from datetime import date
15
  import nltk
 
16
 
 
17
  np.set_printoptions(suppress=True)
18
 
19
 
@@ -156,18 +158,17 @@ AI DETECTION SECTION
156
  """
157
 
158
  text_bc_model_path = "polygraf-ai/ai-text-bc-bert-1-4m"
159
- text_bc_tokenizer = AutoTokenizer.from_pretrained(text_bc_model_path)
160
  text_bc_model = AutoModelForSequenceClassification.from_pretrained(
161
- text_bc_model_path
162
  )
163
 
164
  text_mc_model_path = "polygraf-ai/ai-text-mc-v5-lighter-spec"
165
- text_mc_tokenizer = AutoTokenizer.from_pretrained(text_mc_model_path)
166
  text_mc_model = AutoModelForSequenceClassification.from_pretrained(
167
- text_mc_model_path
168
  )
169
 
170
-
171
  def remove_special_characters(text):
172
  cleaned_text = re.sub(r'[^a-zA-Z0-9\s]', '', text)
173
  return cleaned_text
 
13
  from evaluate import load
14
  from datetime import date
15
  import nltk
16
+ import os
17
 
18
+ use_auth_token = os.environ["MC_BC_TOKEN"]
19
  np.set_printoptions(suppress=True)
20
 
21
 
 
158
  """
159
 
160
  text_bc_model_path = "polygraf-ai/ai-text-bc-bert-1-4m"
161
+ text_bc_tokenizer = AutoTokenizer.from_pretrained(text_bc_model_path, use_auth_token=True)
162
  text_bc_model = AutoModelForSequenceClassification.from_pretrained(
163
+ text_bc_model_path, use_auth_token=True
164
  )
165
 
166
  text_mc_model_path = "polygraf-ai/ai-text-mc-v5-lighter-spec"
167
+ text_mc_tokenizer = AutoTokenizer.from_pretrained(text_mc_model_path, use_auth_token=True)
168
  text_mc_model = AutoModelForSequenceClassification.from_pretrained(
169
+ text_mc_model_path, use_auth_token=True
170
  )
171
 
 
172
  def remove_special_characters(text):
173
  cleaned_text = re.sub(r'[^a-zA-Z0-9\s]', '', text)
174
  return cleaned_text