Soumen commited on
Commit
1272866
·
1 Parent(s): 419e04c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -35,9 +35,6 @@ import numpy as np
35
  import pytesseract
36
  #pytesseract.pytesseract.tesseract_cmd = r"./Tesseract-OCR/tesseract.exe"
37
  from PIL import Image
38
- # Function to Analyse Tokens and Lemma
39
- tokenizer = AutoTokenizer.from_pretrained('t5-base')
40
- model = AutoModelWithLMHead.from_pretrained('t5-base', return_dict=True)
41
  @st.cache
42
  def text_analyzer(my_text):
43
  nlp = spacy.load('en_core_web_sm')
@@ -130,6 +127,9 @@ def main():
130
 
131
  elif st.checkbox("Show Text Summarization T5"):
132
  st.subheader("Summarize Your Text")
 
 
 
133
  #message = st.text_area("Enter the Text","Type please ..")
134
  st.text("Using Google T5 Transformer ..")
135
  inputs = tokenizer.encode("summarize: " + text,
 
35
  import pytesseract
36
  #pytesseract.pytesseract.tesseract_cmd = r"./Tesseract-OCR/tesseract.exe"
37
  from PIL import Image
 
 
 
38
  @st.cache
39
  def text_analyzer(my_text):
40
  nlp = spacy.load('en_core_web_sm')
 
127
 
128
  elif st.checkbox("Show Text Summarization T5"):
129
  st.subheader("Summarize Your Text")
130
+ tokenizer = AutoTokenizer.from_pretrained('t5-base')
131
+ model = AutoModelWithLMHead.from_pretrained('t5-base', return_dict=True)
132
+ # Function to Analyse Tokens and Lemma
133
  #message = st.text_area("Enter the Text","Type please ..")
134
  st.text("Using Google T5 Transformer ..")
135
  inputs = tokenizer.encode("summarize: " + text,