wjjessen commited on
Commit
990e81e
·
1 Parent(s): bb2f7b8

update code

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -57,13 +57,13 @@ def file_preprocessing(file, skipfirst, skiplast):
57
  def preproc_count(filepath, skipfirst, skiplast):
58
  input_text = file_preprocessing(filepath, skipfirst, skiplast)
59
  text_length = len(input_text)
60
- print("Preproc input word count:%s" %(text_length))
61
  return input_text, text_length
62
 
63
 
64
  def postproc_count(summary):
65
  text_length = len(summary)
66
- print("Postproc summary word count:%s" %(text_length))
67
  return text_length
68
 
69
 
@@ -77,12 +77,13 @@ def llm_pipeline(tokenizer, base_model, input_text):
77
  min_length=300,
78
  truncation=True,
79
  )
 
80
  result = pipe_sum(input_text)
81
  result = result[0]["summary_text"]
82
  return result
83
 
84
 
85
- @st.cache_data
86
  # function to display the PDF
87
  def displayPDF(file):
88
  with open(file, "rb") as f:
 
57
  def preproc_count(filepath, skipfirst, skiplast):
58
  input_text = file_preprocessing(filepath, skipfirst, skiplast)
59
  text_length = len(input_text)
60
+ print("Preproc input word count: %s" %(text_length))
61
  return input_text, text_length
62
 
63
 
64
  def postproc_count(summary):
65
  text_length = len(summary)
66
+ print("Postproc summary word count: %s" %(text_length))
67
  return text_length
68
 
69
 
 
77
  min_length=300,
78
  truncation=True,
79
  )
80
+ print("Summarizing...")
81
  result = pipe_sum(input_text)
82
  result = result[0]["summary_text"]
83
  return result
84
 
85
 
86
+ @st.cache_data(ttl=60*60)
87
  # function to display the PDF
88
  def displayPDF(file):
89
  with open(file, "rb") as f: