Spaces:
Build error
Build error
Update app.py
Browse files
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])
|