Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
| 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 |
|