Spaces:
Runtime error
Runtime error
Commit
·
edd0a27
1
Parent(s):
6fa9846
Update app.py
Browse files
app.py
CHANGED
@@ -6,10 +6,10 @@ from gradio.mix import Parallel
|
|
6 |
tokenizer_t5 = T5Tokenizer.from_pretrained("panggi/t5-base-indonesian-summarization-cased")
|
7 |
model_t5 = T5ForConditionalGeneration.from_pretrained("panggi/t5-base-indonesian-summarization-cased")
|
8 |
|
9 |
-
tokenizer_bert = BertTokenizer.from_pretrained("cahya/bert2bert-indonesian-summarization")
|
10 |
-
tokenizer_bert.bos_token = tokenizer_bert.cls_token
|
11 |
-
tokenizer_bert.eos_token = tokenizer_bert.sep_token
|
12 |
-
model_bert = EncoderDecoderModel.from_pretrained("cahya/bert2bert-indonesian-summarization")
|
13 |
|
14 |
t5_para_tokenizer = AutoTokenizer.from_pretrained("Wikidepia/IndoT5-base-paraphrase")
|
15 |
t5_para_model = AutoModelForSeq2SeqLM.from_pretrained("Wikidepia/IndoT5-base-paraphrase")
|
@@ -66,9 +66,9 @@ def para_t5(text):
|
|
66 |
|
67 |
def summarize(text):
|
68 |
t5_ = summ_t5(text)
|
69 |
-
bert_ = summ_bert(text)
|
70 |
para_ = para_t5(t5_)
|
71 |
-
return t5_,
|
72 |
|
73 |
if __name__ == "__main__":
|
74 |
with gr.Blocks() as demo:
|
@@ -78,7 +78,7 @@ if __name__ == "__main__":
|
|
78 |
analyze_button = gr.Button(label="Analyze")
|
79 |
with gr.Column():
|
80 |
t5_output = gr.Textbox(label="T5 Base Output")
|
81 |
-
bert_output = gr.Textbox(label="Bert Base Output")
|
82 |
para_output = gr.Textbox(label="T5 Paraphrase Output")
|
83 |
-
analyze_button.click(summarize, input_text, [t5_output,
|
84 |
demo.launch()
|
|
|
6 |
tokenizer_t5 = T5Tokenizer.from_pretrained("panggi/t5-base-indonesian-summarization-cased")
|
7 |
model_t5 = T5ForConditionalGeneration.from_pretrained("panggi/t5-base-indonesian-summarization-cased")
|
8 |
|
9 |
+
#tokenizer_bert = BertTokenizer.from_pretrained("cahya/bert2bert-indonesian-summarization")
|
10 |
+
#tokenizer_bert.bos_token = tokenizer_bert.cls_token
|
11 |
+
#tokenizer_bert.eos_token = tokenizer_bert.sep_token
|
12 |
+
#model_bert = EncoderDecoderModel.from_pretrained("cahya/bert2bert-indonesian-summarization")
|
13 |
|
14 |
t5_para_tokenizer = AutoTokenizer.from_pretrained("Wikidepia/IndoT5-base-paraphrase")
|
15 |
t5_para_model = AutoModelForSeq2SeqLM.from_pretrained("Wikidepia/IndoT5-base-paraphrase")
|
|
|
66 |
|
67 |
def summarize(text):
|
68 |
t5_ = summ_t5(text)
|
69 |
+
#bert_ = summ_bert(text)
|
70 |
para_ = para_t5(t5_)
|
71 |
+
return t5_, para_
|
72 |
|
73 |
if __name__ == "__main__":
|
74 |
with gr.Blocks() as demo:
|
|
|
78 |
analyze_button = gr.Button(label="Analyze")
|
79 |
with gr.Column():
|
80 |
t5_output = gr.Textbox(label="T5 Base Output")
|
81 |
+
#bert_output = gr.Textbox(label="Bert Base Output")
|
82 |
para_output = gr.Textbox(label="T5 Paraphrase Output")
|
83 |
+
analyze_button.click(summarize, input_text, [t5_output, para_output])
|
84 |
demo.launch()
|