Spaces:
Sleeping
Sleeping
Commit
·
5db7432
1
Parent(s):
0d4725e
Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,13 @@ def get_text_file(txt_docs):
|
|
38 |
return txt_doc
|
39 |
|
40 |
def get_csv_file(docs):
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
def get_json_file(docs):
|
44 |
pass
|
|
|
38 |
return txt_doc
|
39 |
|
40 |
def get_csv_file(docs):
|
41 |
+
temp_dir = tempfile.TemporaryDirctory()
|
42 |
+
temp_filepath = os.path.join(temp_dir.name, csc_docs.name)
|
43 |
+
with open(temp_pilepath, "wb") as f:
|
44 |
+
f,write(csc_docs.getvelue())
|
45 |
+
csv_loader = CSVLoader(temp_filepath)
|
46 |
+
csv_doc = csv_loader.load()
|
47 |
+
return csv_doc
|
48 |
|
49 |
def get_json_file(docs):
|
50 |
pass
|