Skip to content

Commit

Permalink
๐Ÿ—ƒ๏ธ fix: allow JSON Upload (#30)
Browse files Browse the repository at this point in the history
* ๐Ÿ—ƒ๏ธf fix: allow JSON Upload

* add file ext
  • Loading branch information
danny-avila authored May 3, 2024
1 parent a62ffd3 commit c2dda20
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ def get_loader(filename: str, file_content_type: str, filepath: str):
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
] or file_ext in ["xls", "xlsx"]:
loader = UnstructuredExcelLoader(filepath)
elif file_content_type == "application/json" or file_ext == "json":
loader = TextLoader(filepath, autodetect_encoding=True)
elif file_ext in known_source_ext or (
file_content_type and file_content_type.find("text/") >= 0
):
Expand Down

0 comments on commit c2dda20

Please sign in to comment.