mirror of
https://github.com/StanGirard/quivr.git
synced 2024-11-27 10:20:32 +03:00
Add support for jupyter notebooks.
This commit is contained in:
parent
70a70d0c17
commit
514f3b352a
@ -19,6 +19,7 @@ from parsers.txt import process_txt
|
|||||||
from parsers.csv import process_csv
|
from parsers.csv import process_csv
|
||||||
from parsers.docx import process_docx
|
from parsers.docx import process_docx
|
||||||
from parsers.pdf import process_pdf
|
from parsers.pdf import process_pdf
|
||||||
|
from parsers.notebook import process_ipnyb
|
||||||
from parsers.markdown import process_markdown
|
from parsers.markdown import process_markdown
|
||||||
from parsers.powerpoint import process_powerpoint
|
from parsers.powerpoint import process_powerpoint
|
||||||
from parsers.html import process_html
|
from parsers.html import process_html
|
||||||
@ -91,6 +92,7 @@ file_processors = {
|
|||||||
".pptx": process_powerpoint,
|
".pptx": process_powerpoint,
|
||||||
".docx": process_docx,
|
".docx": process_docx,
|
||||||
".epub": process_epub,
|
".epub": process_epub,
|
||||||
|
".ipynb": process_ipnyb,
|
||||||
}
|
}
|
||||||
|
|
||||||
async def filter_file(file: UploadFile, supabase, vector_store, stats_db):
|
async def filter_file(file: UploadFile, supabase, vector_store, stats_db):
|
||||||
|
7
backend/parsers/notebook.py
Normal file
7
backend/parsers/notebook.py
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
from .common import process_file
|
||||||
|
from langchain.document_loaders import NotebookLoader
|
||||||
|
from fastapi import UploadFile
|
||||||
|
|
||||||
|
|
||||||
|
def process_ipnyb(vector_store, file: UploadFile, stats_db):
|
||||||
|
return process_file(vector_store, file, NotebookLoader, "ipynb", stats_db=stats_db)
|
Loading…
Reference in New Issue
Block a user