JinHyeong99 commited on
Commit
f0ea068
·
1 Parent(s): ffe03b9
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -51,14 +51,10 @@ def get_json_file(json_docs):
51
  temp_dir = tempfile.TemporaryDirectory()
52
  temp_filepath = os.path.join(temp_dir.name, json_docs.name)
53
  with open(temp_filepath, "wb") as f:
54
- # 파일에 쓰기 전에 데이터가 bytes 형식인지 확인
55
- data_to_write = json_docs.getvalue()
56
- if isinstance(data_to_write, str):
57
- data_to_write = data_to_write.encode() # str을 bytes로 변환
58
- f.write(data_to_write)
59
  json_loader = JSONLoader(
60
  file_path=temp_filepath,
61
- jq_schema=None)
62
  json_doc = json_loader.load()
63
  return json_doc
64
 
 
51
  temp_dir = tempfile.TemporaryDirectory()
52
  temp_filepath = os.path.join(temp_dir.name, json_docs.name)
53
  with open(temp_filepath, "wb") as f:
54
+ f.write(json_docs.getvalue())
 
 
 
 
55
  json_loader = JSONLoader(
56
  file_path=temp_filepath,
57
+ jq_schema='.')
58
  json_doc = json_loader.load()
59
  return json_doc
60