update code
Browse files
app.py
CHANGED
@@ -152,19 +152,19 @@ def main():
|
|
152 |
with open(filepath, "wb") as temp_file:
|
153 |
temp_file.write(uploaded_file.read())
|
154 |
with col1:
|
155 |
-
input_text,
|
156 |
st.info(
|
157 |
"Uploaded PDF | Number of words: "
|
158 |
-
f"{
|
159 |
)
|
160 |
pdf_viewer = displayPDF(filepath)
|
161 |
with col2:
|
162 |
with st.spinner("Please wait..."):
|
163 |
summary = llm_pipeline(tokenizer, base_model, input_text)
|
164 |
-
|
165 |
st.info(
|
166 |
"PDF Summary | Number of words: "
|
167 |
-
f"{
|
168 |
)
|
169 |
st.success(summary)
|
170 |
|
|
|
152 |
with open(filepath, "wb") as temp_file:
|
153 |
temp_file.write(uploaded_file.read())
|
154 |
with col1:
|
155 |
+
input_text, preproc_text_length = preproc_count(filepath, skipfirst, skiplast)
|
156 |
st.info(
|
157 |
"Uploaded PDF | Number of words: "
|
158 |
+
f"{preproc_text_length:,}"
|
159 |
)
|
160 |
pdf_viewer = displayPDF(filepath)
|
161 |
with col2:
|
162 |
with st.spinner("Please wait..."):
|
163 |
summary = llm_pipeline(tokenizer, base_model, input_text)
|
164 |
+
postproc_text_length = postproc_count(summary)
|
165 |
st.info(
|
166 |
"PDF Summary | Number of words: "
|
167 |
+
f"{postproc_text_length:,}"
|
168 |
)
|
169 |
st.success(summary)
|
170 |
|