Spaces:
Sleeping
Sleeping
Update file_processing.py
Browse files- file_processing.py +4 -4
file_processing.py
CHANGED
@@ -43,12 +43,12 @@ def read_docx(file_path: str) -> str:
|
|
43 |
return text
|
44 |
|
45 |
def read_csv(file_path: str) -> str:
|
46 |
-
loader
|
47 |
-
data
|
48 |
return data
|
49 |
def read_txt(file_path: str) -> str:
|
50 |
-
loader
|
51 |
-
text
|
52 |
return text
|
53 |
|
54 |
async def load_documents(file: UploadFile) -> List[Document]:
|
|
|
43 |
return text
|
44 |
|
45 |
def read_csv(file_path: str) -> str:
|
46 |
+
loader=CSVLoader(file_path)
|
47 |
+
data=loader.load()
|
48 |
return data
|
49 |
def read_txt(file_path: str) -> str:
|
50 |
+
loader=TextLoader(file_path)
|
51 |
+
text=loader.load()
|
52 |
return text
|
53 |
|
54 |
async def load_documents(file: UploadFile) -> List[Document]:
|