minji1115
commited on
Commit
·
46cd747
1
Parent(s):
79eab9e
fin?
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ def get_text_file(text_docs):
|
|
42 |
def get_csv_file(csv_docs):
|
43 |
temp_dir = tempfile.TemporaryDirectory()
|
44 |
temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
|
45 |
-
with open(temp_filepath, "
|
46 |
f.write(csv_docs.getvalue())
|
47 |
csv_loader = CSVLoader(file_path = temp_filepath)
|
48 |
csv_doc = csv_loader.load()
|
@@ -51,7 +51,7 @@ def get_csv_file(csv_docs):
|
|
51 |
def get_json_file(json_docs):
|
52 |
temp_dir = tempfile.TemporaryDirectory()
|
53 |
temp_filepath = os.path.join(temp_dir.name, json_docs.name)
|
54 |
-
with open(temp_filepath, "
|
55 |
f.write(json_docs.getvalue())
|
56 |
json_loader = JSONLoader(file_path = temp_filepath, jq_schema = '.messages[].content', text_content = False)
|
57 |
json_doc = json_loader.load()
|
|
|
42 |
def get_csv_file(csv_docs):
|
43 |
temp_dir = tempfile.TemporaryDirectory()
|
44 |
temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
|
45 |
+
with open(temp_filepath, "w") as f:
|
46 |
f.write(csv_docs.getvalue())
|
47 |
csv_loader = CSVLoader(file_path = temp_filepath)
|
48 |
csv_doc = csv_loader.load()
|
|
|
51 |
def get_json_file(json_docs):
|
52 |
temp_dir = tempfile.TemporaryDirectory()
|
53 |
temp_filepath = os.path.join(temp_dir.name, json_docs.name)
|
54 |
+
with open(temp_filepath, "w") as f:
|
55 |
f.write(json_docs.getvalue())
|
56 |
json_loader = JSONLoader(file_path = temp_filepath, jq_schema = '.messages[].content', text_content = False)
|
57 |
json_doc = json_loader.load()
|