Kushwanth Chowday Kandala commited on
Commit
80682f3
1 Parent(s): a987567

TypeError: unsupported operand type(s) for /: 'bytes' and 'float'

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -148,9 +148,9 @@ def combine_text(pages):
148
  for page in tqdm(pages):
149
  text = page.extract_text().strip()
150
  concatenates_text += text
151
- bytesize = bytes(concatenates_text, "utf-8")
152
  p = math.pow(1024, 2)
153
- mbsize = round(bytesize / p, 2)
154
  st.write(f"There are {len(concatenates_text)} characters in the pdf with {mbsize}MB size")
155
 
156
  with st.sidebar:
 
148
  for page in tqdm(pages):
149
  text = page.extract_text().strip()
150
  concatenates_text += text
151
+ bytesize = concatenates_text.encode("utf-8")
152
  p = math.pow(1024, 2)
153
+ mbsize = round(len(bytesize) / p, 2)
154
  st.write(f"There are {len(concatenates_text)} characters in the pdf with {mbsize}MB size")
155
 
156
  with st.sidebar: