JinHyeong99 commited on
Commit
5b9a00a
1 Parent(s): 0a4e5b0
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -49,16 +49,12 @@ def get_csv_file(csv_docs):
49
  def get_json_file(json_docs):
50
  temp_dir = tempfile.TemporaryDirectory()
51
  temp_filepath = os.path.join(temp_dir.name, json_docs.name)
52
-
53
- data = open(json_docs, mode='r', encoding='utf-8')
54
- with open(temp_filepath) as f:
55
- f.write(data)
56
-
57
- json_loader = JSONLoader(
58
- file_path = temp_filepath,
59
- jq_schema = '.',
60
- text_content=False
61
- )
62
  json_doc = json_loader.load()
63
  return json_doc
64
 
 
49
  def get_json_file(json_docs):
50
  temp_dir = tempfile.TemporaryDirectory()
51
  temp_filepath = os.path.join(temp_dir.name, json_docs.name)
52
+ with open(temp_filepath, "wb") as f:
53
+ f.write(json_docs.getvalue())
54
+ json_loader = JSONLoader(temp_filepath,
55
+ jq_schema='.',
56
+ text_content=False
57
+ )
 
 
 
 
58
  json_doc = json_loader.load()
59
  return json_doc
60