Spaces:
Sleeping
Sleeping
Commit
·
968bb54
1
Parent(s):
9989377
edit app.py
Browse files
app.py
CHANGED
@@ -34,8 +34,8 @@ def get_text_file(docs):
|
|
34 |
temp_filepath = os.path.join(temp_dir.name, docs.name)
|
35 |
with open(temp_filepath, "wb") as f:
|
36 |
f.write(docs.getvalue())
|
37 |
-
|
38 |
-
text_doc =
|
39 |
return text_doc
|
40 |
|
41 |
|
@@ -44,8 +44,8 @@ def get_csv_file(csv_docs):
|
|
44 |
temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
|
45 |
with open(temp_filepath, "wb") as f:
|
46 |
f.write(csv_docs.getvalue())
|
47 |
-
|
48 |
-
csv_doc =
|
49 |
return csv_doc
|
50 |
|
51 |
|
@@ -54,8 +54,8 @@ def get_json_file(json_docs):
|
|
54 |
temp_filepath = os.path.join(temp_dir.name, json_docs.name)
|
55 |
with open(temp_filepath, "wb") as f:
|
56 |
f.write(json_docs.getvalue())
|
57 |
-
|
58 |
-
json_doc =
|
59 |
return json_doc
|
60 |
|
61 |
|
|
|
34 |
temp_filepath = os.path.join(temp_dir.name, docs.name)
|
35 |
with open(temp_filepath, "wb") as f:
|
36 |
f.write(docs.getvalue())
|
37 |
+
loader = TextLoader(temp_filepath)
|
38 |
+
text_doc = loader.load()
|
39 |
return text_doc
|
40 |
|
41 |
|
|
|
44 |
temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
|
45 |
with open(temp_filepath, "wb") as f:
|
46 |
f.write(csv_docs.getvalue())
|
47 |
+
loader = CSVLoader(temp_filepath)
|
48 |
+
csv_doc = loader.load()
|
49 |
return csv_doc
|
50 |
|
51 |
|
|
|
54 |
temp_filepath = os.path.join(temp_dir.name, json_docs.name)
|
55 |
with open(temp_filepath, "wb") as f:
|
56 |
f.write(json_docs.getvalue())
|
57 |
+
loader = JSONLoader(temp_filepath, jq_schema="테스트")
|
58 |
+
json_doc = loader.load()
|
59 |
return json_doc
|
60 |
|
61 |
|