MeiJuice commited on
Commit
35b1401
·
1 Parent(s): 1c1836f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -10,12 +10,12 @@ pipeline_zh = pipeline(task="text-classification", model="MeiJuice/CheckGPT-Chin
10
 
11
 
12
  def predict_en(text):
13
- res = pipeline_en(text)[0]
14
  return "ChatGPT" if res['label'] == "LABEL_1" else "human", res['score']
15
 
16
 
17
  def predict_zh(text):
18
- res = pipeline_zh(text[:512])[0]
19
  return "ChatGPT" if res['label'] == "LABEL_1" else "human", res['score']
20
 
21
 
 
10
 
11
 
12
  def predict_en(text):
13
+ res = pipeline_en(text, truncation=True)[0]
14
  return "ChatGPT" if res['label'] == "LABEL_1" else "human", res['score']
15
 
16
 
17
  def predict_zh(text):
18
+ res = pipeline_zh(text, truncation=True, max_length=512)[0]
19
  return "ChatGPT" if res['label'] == "LABEL_1" else "human", res['score']
20
 
21