Update app.py
Browse files
app.py
CHANGED
@@ -62,14 +62,10 @@ def read_pdf(file):
|
|
62 |
# # Display the extracted text
|
63 |
# #st.text(extracted_text)
|
64 |
# return extracted_text
|
65 |
-
|
66 |
-
|
67 |
-
tokenizer = AutoTokenizer.from_pretrained('t5-base')
|
68 |
-
model = AutoModelWithLMHead.from_pretrained('t5-base', return_dict=True)
|
69 |
-
return tokenizer, model
|
70 |
@st.cache(suppress_st_warning=True)
|
71 |
def engsum(text):
|
72 |
-
tokenizer, model = l()
|
73 |
#st.text("Using Google T5 Transformer ..")
|
74 |
inputs = tokenizer.encode("summarize: " + text,return_tensors='pt',
|
75 |
max_length= 512,
|
|
|
62 |
# # Display the extracted text
|
63 |
# #st.text(extracted_text)
|
64 |
# return extracted_text
|
65 |
+
tokenizer = AutoTokenizer.from_pretrained('t5-base')
|
66 |
+
model = AutoModelWithLMHead.from_pretrained('t5-base', return_dict=True)
|
|
|
|
|
|
|
67 |
@st.cache(suppress_st_warning=True)
|
68 |
def engsum(text):
|
|
|
69 |
#st.text("Using Google T5 Transformer ..")
|
70 |
inputs = tokenizer.encode("summarize: " + text,return_tensors='pt',
|
71 |
max_length= 512,
|