raz-1412 commited on
Commit
8327a5b
·
verified ·
1 Parent(s): c70fb7b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -39,7 +39,7 @@ def extract_text_from_file(uploaded_file):
39
  text = soup.get_text()
40
  elif file_type == "json":
41
  data = json.load(uploaded_file)
42
- text = "\n".join(data.values()) if isinstance(data, dict) else "\n".join(data)
43
  elif file_type == "pdf":
44
  doc = fitz.open(stream=uploaded_file.read(), filetype="pdf")
45
  text = "\n".join([page.get_text("text") for page in doc])
 
39
  text = soup.get_text()
40
  elif file_type == "json":
41
  data = json.load(uploaded_file)
42
+ text = "\n".join(map(str, data.values())) if isinstance(data, dict) else "\n".join(map(str, data))
43
  elif file_type == "pdf":
44
  doc = fitz.open(stream=uploaded_file.read(), filetype="pdf")
45
  text = "\n".join([page.get_text("text") for page in doc])