Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ from t5.t5_model import T5Model
|
|
3 |
from transformers import AutoTokenizer, T5ForConditionalGeneration
|
4 |
#tokenizer = AutoTokenizer.from_pretrained("CodeTed/traditional_CSC_t5")
|
5 |
#model = T5ForConditionalGeneration.from_pretrained("CodeTed/traditional_CSC_t5")
|
6 |
-
model = T5Model('t5', "CodeTed/
|
7 |
|
8 |
def cged_correction(sentence = '為了降低少子化,政府可以堆動獎勵生育的政策。'):
|
9 |
for _ in range(3):
|
|
|
3 |
from transformers import AutoTokenizer, T5ForConditionalGeneration
|
4 |
#tokenizer = AutoTokenizer.from_pretrained("CodeTed/traditional_CSC_t5")
|
5 |
#model = T5ForConditionalGeneration.from_pretrained("CodeTed/traditional_CSC_t5")
|
6 |
+
model = T5Model('t5', "CodeTed/Chinese_Spelling_Correction_T5", args={"eval_batch_size": 1}, cuda_device=-1, evaluate=True)
|
7 |
|
8 |
def cged_correction(sentence = '為了降低少子化,政府可以堆動獎勵生育的政策。'):
|
9 |
for _ in range(3):
|