JinHyeong99 commited on
Commit
8075e7f
ยท
1 Parent(s): 58c8c1d
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -50,8 +50,10 @@ def get_csv_file(csv_docs):
50
  def get_json_file(json_docs):
51
  temp_dir = tempfile.TemporaryDirectory()
52
  temp_filepath = os.path.join(temp_dir.name, json_docs.name)
53
- data = json_docs.getvalue()
 
54
 
 
55
  if isinstance(data, bytes):
56
  mode = "wb"
57
  elif isinstance(data, str):
@@ -64,7 +66,7 @@ def get_json_file(json_docs):
64
 
65
  json_loader = JSONLoader(
66
  file_path=temp_filepath,
67
- jq_schema='.')
68
  json_doc = json_loader.load()
69
  return json_doc
70
 
 
50
  def get_json_file(json_docs):
51
  temp_dir = tempfile.TemporaryDirectory()
52
  temp_filepath = os.path.join(temp_dir.name, json_docs.name)
53
+ # read() ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์ฝ๊ธฐ
54
+ data = json_docs.read()
55
 
56
+ # ๋ฐ์ดํ„ฐ ํƒ€์ž…์— ๋”ฐ๋ผ ์ ์ ˆํ•œ ๋ชจ๋“œ ์„ ํƒ
57
  if isinstance(data, bytes):
58
  mode = "wb"
59
  elif isinstance(data, str):
 
66
 
67
  json_loader = JSONLoader(
68
  file_path=temp_filepath,
69
+ jq_schema=None)
70
  json_doc = json_loader.load()
71
  return json_doc
72