CodeTed commited on
Commit
86848fa
1 Parent(s): 3cc19cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- sentence = model.predict([prompt[function] + sentence + "_輸出句:"])[0]
 
14
  #edited_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
15
- return sentence
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(