Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,13 @@ def get_text_file(docs):
|
|
38 |
return text_doc
|
39 |
|
40 |
def get_csv_file(docs):
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
def get_json_file(docs):
|
44 |
pass
|
|
|
38 |
return text_doc
|
39 |
|
40 |
def get_csv_file(docs):
|
41 |
+
with NamedTemporaryFile() as temp_file:
|
42 |
+
temp_file.write(docs.getvalue())
|
43 |
+
temp_file.seek(0)
|
44 |
+
text_loader = CSVLoader(temp_file.name)
|
45 |
+
text_doc = text_loader.load()
|
46 |
+
|
47 |
+
return text_doc
|
48 |
|
49 |
def get_json_file(docs):
|
50 |
pass
|