Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add markdown file support #202

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions flowsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
"config": {
"supported_file_types": (
".png, .jpeg, .jpg, .tiff, .tif, .pdf, .xls, .xlsx, .doc, .docx, "
".pptx, .csv, .html, .mhtml, .txt, .zip"
".pptx, .csv, .html, .mhtml, .txt, .md, .zip"
),
"private": False,
},
Expand All @@ -233,7 +233,7 @@
"config": {
"supported_file_types": (
".png, .jpeg, .jpg, .tiff, .tif, .pdf, .xls, .xlsx, .doc, .docx, "
".pptx, .csv, .html, .mhtml, .txt, .zip"
".pptx, .csv, .html, .mhtml, .txt, .md, .zip"
),
"private": False,
},
Expand Down
3 changes: 3 additions & 0 deletions libs/kotaemon/kotaemon/indices/ingests/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
OCRReader,
PandasExcelReader,
PDFThumbnailReader,
TxtReader,
UnstructuredReader,
)

Expand Down Expand Up @@ -47,6 +48,8 @@
".tiff": unstructured,
".tif": unstructured,
".pdf": PDFThumbnailReader(),
".txt": TxtReader(),
".md": TxtReader(),
}


Expand Down
3 changes: 3 additions & 0 deletions libs/ktem/ktem/index/file/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ def download_single_file(self, is_zipped_state, file_id):
return not is_zipped_state, new_button

def download_all_files(self):
if self._index.config.get("private", False):
raise gr.Error("This feature is not available for private collection.")

zip_files = []
for file_name in os.listdir(flowsettings.KH_CHUNKS_OUTPUT_DIR):
zip_files.append(os.path.join(flowsettings.KH_CHUNKS_OUTPUT_DIR, file_name))
Expand Down
Loading