swcrazyfan commited on
Commit
6dbd7d8
1 Parent(s): b83ba86

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -2,9 +2,9 @@ import torch
2
  from transformers import (T5ForConditionalGeneration,T5Tokenizer)
3
  import gradio as gr
4
 
5
- best_model_path = "swcrazyfan/Dekingify-T5-Large"
6
  model = T5ForConditionalGeneration.from_pretrained(best_model_path)
7
- tokenizer = T5Tokenizer.from_pretrained("swcrazyfan/Dekingify-T5-Large")
8
 
9
  def tokenize_data(text):
10
  # Tokenize the review body
@@ -32,6 +32,6 @@ def generate_answers(text):
32
  #iface = gr.Interface(fn=generate_answers, inputs=["Write your text here..."], outputs=["Jamesified text"])
33
  #iface.launch(inline=False, share=True)
34
 
35
- iface = gr.Interface(title="Dekingify", description="Write anything from around the 17th-century below. Then, click submit to 'Dekingify' it (make the text more modern).", fn=generate_answers, inputs=[gr.inputs.Textbox(label="Original Text",lines=10)], outputs=["text"])
36
  #iface = gr.Interface(title="King Jamesify” fn=generate_answers, inputs=[gr.inputs.Textbox(label="Original",lines=30)],outputs=[gr.outputs.Textbox(label="King Jamesified", lines=30)])
37
  iface.launch(inline=False)
 
2
  from transformers import (T5ForConditionalGeneration,T5Tokenizer)
3
  import gradio as gr
4
 
5
+ best_model_path = "swcrazyfan/DeKingify-T5-Large"
6
  model = T5ForConditionalGeneration.from_pretrained(best_model_path)
7
+ tokenizer = T5Tokenizer.from_pretrained("swcrazyfan/DeKingify-T5-Large")
8
 
9
  def tokenize_data(text):
10
  # Tokenize the review body
 
32
  #iface = gr.Interface(fn=generate_answers, inputs=["Write your text here..."], outputs=["Jamesified text"])
33
  #iface.launch(inline=False, share=True)
34
 
35
+ iface = gr.Interface(title="DeKingify", description="Write any English text from the 17th-century. Then, click submit to 'Dekingify' it (try to rephrase it in modern, English language).", fn=generate_answers, inputs=[gr.inputs.Textbox(label="Original Text",lines=10)], outputs=["text"])
36
  #iface = gr.Interface(title="King Jamesify” fn=generate_answers, inputs=[gr.inputs.Textbox(label="Original",lines=30)],outputs=[gr.outputs.Textbox(label="King Jamesified", lines=30)])
37
  iface.launch(inline=False)