Spaces:
Sleeping
Sleeping
akman12914
commited on
Commit
Β·
eb4114a
1
Parent(s):
e70c205
JSONLoader revise
Browse files
app.py
CHANGED
@@ -55,13 +55,13 @@ def get_csv_file(docs):
|
|
55 |
def get_json_file(docs):
|
56 |
temp_dir = tempfile.TemporaryDirectory()
|
57 |
temp_filepath = os.path.join(temp_dir.name, docs.name)
|
58 |
-
with open(temp_filepath,
|
59 |
f.write(docs.getvalue())
|
60 |
json_loader = JSONLoader(file_path=temp_filepath,
|
61 |
jq_schema='.messages[].content',
|
62 |
text_content=False)
|
63 |
-
|
64 |
-
return
|
65 |
|
66 |
|
67 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|
|
|
55 |
def get_json_file(docs):
|
56 |
temp_dir = tempfile.TemporaryDirectory()
|
57 |
temp_filepath = os.path.join(temp_dir.name, docs.name)
|
58 |
+
with open(temp_filepath, "wb") as f:
|
59 |
f.write(docs.getvalue())
|
60 |
json_loader = JSONLoader(file_path=temp_filepath,
|
61 |
jq_schema='.messages[].content',
|
62 |
text_content=False)
|
63 |
+
data = json_loader.load()
|
64 |
+
return data
|
65 |
|
66 |
|
67 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|