nickmuchi commited on
Commit
28626a1
·
1 Parent(s): 4e95f0e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -9,6 +9,7 @@ from fake_useragent import UserAgent
9
  from bs4 import BeautifulSoup
10
  import streamlit as st
11
  from transformers import pipeline
 
12
  import base64
13
  import requests
14
  import docx2txt
@@ -114,8 +115,10 @@ def extract_text_from_file(file):
114
  return file_text
115
 
116
  def summary_downloader(raw_text):
 
 
117
  b64 = base64.b64encode(raw_text.encode()).decode()
118
- new_filename = "new_text_file_{}_.txt".format(timestr)
119
  st.markdown("#### Download Summary as a File ###")
120
  href = f'<a href="data:file/txt;base64,{b64}" download="{new_filename}">Click to Download!!</a>'
121
  st.markdown(href,unsafe_allow_html=True)
 
9
  from bs4 import BeautifulSoup
10
  import streamlit as st
11
  from transformers import pipeline
12
+ import time
13
  import base64
14
  import requests
15
  import docx2txt
 
115
  return file_text
116
 
117
  def summary_downloader(raw_text):
118
+
119
+ time_str = time.strftime("%d%m%Y-%H%M%S")
120
  b64 = base64.b64encode(raw_text.encode()).decode()
121
+ new_filename = "new_text_file_{}_.txt".format(time_str)
122
  st.markdown("#### Download Summary as a File ###")
123
  href = f'<a href="data:file/txt;base64,{b64}" download="{new_filename}">Click to Download!!</a>'
124
  st.markdown(href,unsafe_allow_html=True)