TedYeh
commited on
Commit
•
c2ec08b
1
Parent(s):
772bcbe
update app
Browse files
app.py
CHANGED
@@ -6,7 +6,9 @@ from transformers import AutoTokenizer, T5ForConditionalGeneration
|
|
6 |
model = T5Model('t5', "CodeTed/traditional_CSC_t5", args={"eval_batch_size": 1}, cuda_device=-1, evaluate=True)
|
7 |
|
8 |
def cged_correction(sentence = '為了降低少子化,政府可以堆動獎勵生育的政策。'):
|
9 |
-
|
|
|
|
|
10 |
return outputs[0]
|
11 |
|
12 |
with gr.Blocks() as demo:
|
|
|
6 |
model = T5Model('t5', "CodeTed/traditional_CSC_t5", args={"eval_batch_size": 1}, cuda_device=-1, evaluate=True)
|
7 |
|
8 |
def cged_correction(sentence = '為了降低少子化,政府可以堆動獎勵生育的政策。'):
|
9 |
+
for _ in range(3):
|
10 |
+
outputs = model.predict(["糾正句子中的錯字:" + sentence + "_輸出句:"])
|
11 |
+
sentence = outputs[0]
|
12 |
return outputs[0]
|
13 |
|
14 |
with gr.Blocks() as demo:
|