OhST commited on
Commit
a7ff311
1 Parent(s): f7b0bda

return 값을 json_doc로 수정

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -34,11 +34,11 @@ def get_text_file(txt_docs):
34
  def get_csv_file(docs):
35
  pass
36
 
37
- def get_json_file(json_doc):
38
- temp_dir = tempfile.TemporaryDirectory() # 임시 디렉토리를 생성합니다.
39
- temp_filepath = os.path.join(temp_dir.name, json_doc.name) # 임시 파일 경로를 생성합니다.
40
- with open(temp_filepath, "wb") as f: # 임시 파일을 바이너리 쓰기 모드로 엽니다.
41
- f.write(json_doc.getvalue())
42
  json_loader = JSONLoader(temp_filepath)
43
  json_doc = json_loader.load()
44
  return json_doc
 
34
  def get_csv_file(docs):
35
  pass
36
 
37
+ def get_json_file(json_docs):
38
+ temp_dir = tempfile.TemporaryDirectory()
39
+ temp_filepath = os.path.join(temp_dir.name, json_docs.name)
40
+ with open(temp_filepath, "wb") as f:
41
+ f.write(json_docs.getvalue())
42
  json_loader = JSONLoader(temp_filepath)
43
  json_doc = json_loader.load()
44
  return json_doc