Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
hide_main_and_footer_style = """
|
| 2 |
<style>
|
| 3 |
#MainMenu {visibility: hidden;} footer{visibility: hidden;}
|
|
@@ -7,10 +15,6 @@ hide_main_and_footer_style = """
|
|
| 7 |
|
| 8 |
st.markdown(hide_main_and_footer_style, unsafe_allow_html=True)
|
| 9 |
|
| 10 |
-
import torch
|
| 11 |
-
from transformers import PegasusForConditionalGeneration, PegasusTokenizer
|
| 12 |
-
|
| 13 |
-
|
| 14 |
model_name = 'tuner007/pegasus_paraphrase'
|
| 15 |
torch_device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 16 |
tokenizer = PegasusTokenizer.from_pretrained(model_name)
|
|
@@ -64,8 +68,6 @@ def summarize(text):
|
|
| 64 |
# return tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
| 65 |
|
| 66 |
|
| 67 |
-
import streamlit as st
|
| 68 |
-
#from .paraphraser import get_paraphrased_sentences, model, tokenizer
|
| 69 |
|
| 70 |
|
| 71 |
def app():
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
import torch
|
| 4 |
+
from transformers import PegasusForConditionalGeneration, PegasusTokenizer
|
| 5 |
+
|
| 6 |
+
import streamlit as st
|
| 7 |
+
#from .paraphraser import get_paraphrased_sentences, model, tokenizer
|
| 8 |
+
|
| 9 |
hide_main_and_footer_style = """
|
| 10 |
<style>
|
| 11 |
#MainMenu {visibility: hidden;} footer{visibility: hidden;}
|
|
|
|
| 15 |
|
| 16 |
st.markdown(hide_main_and_footer_style, unsafe_allow_html=True)
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
model_name = 'tuner007/pegasus_paraphrase'
|
| 19 |
torch_device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 20 |
tokenizer = PegasusTokenizer.from_pretrained(model_name)
|
|
|
|
| 68 |
# return tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
| 69 |
|
| 70 |
|
|
|
|
|
|
|
| 71 |
|
| 72 |
|
| 73 |
def app():
|