Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,9 +10,10 @@ def cged_correction(sentence, function):
|
|
| 10 |
"文本重構":"在不改動文意的情況下改寫句子:", "文本簡化":"在不改動文意的情況下改寫句子:", "整體校正":"修改句子的錯誤或使其更通順:"}
|
| 11 |
#input_ids = tokenizer(prompt[function] + sentence, return_tensors="pt").input_ids
|
| 12 |
for _ in range(3):
|
| 13 |
-
|
|
|
|
| 14 |
#edited_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 15 |
-
return
|
| 16 |
|
| 17 |
with gr.Blocks() as demo:
|
| 18 |
gr.Markdown(
|
|
|
|
| 10 |
"文本重構":"在不改動文意的情況下改寫句子:", "文本簡化":"在不改動文意的情況下改寫句子:", "整體校正":"修改句子的錯誤或使其更通順:"}
|
| 11 |
#input_ids = tokenizer(prompt[function] + sentence, return_tensors="pt").input_ids
|
| 12 |
for _ in range(3):
|
| 13 |
+
output = model.predict([prompt[function] + sentence + "_輸出句:"])
|
| 14 |
+
sentence = output[0]
|
| 15 |
#edited_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 16 |
+
return output[0]
|
| 17 |
|
| 18 |
with gr.Blocks() as demo:
|
| 19 |
gr.Markdown(
|