Daoneeee commited on
Commit
230406f
·
1 Parent(s): 29ed47a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -57,13 +57,13 @@ def get_json_file(json_docs):
57
  with open(temp_filepath, "wb") as f:
58
  f.write(json_docs.getvalue())
59
 
60
- # JSONLoader 초기화
61
- json_loader = JSONLoader(temp_filepath, text_content=True)
62
- json_content = json_loader.load()
63
- # JSON 데이터를 문자열로 변환
64
- json_string = json.dumps(json_content)
65
- # 변환된 문자열을 리스트에 담아 반환
66
- return [json_string]
67
 
68
 
69
  # 문서들을 처리하여 텍스트 청크로 나누는 함수입니다.
 
57
  with open(temp_filepath, "wb") as f:
58
  f.write(json_docs.getvalue())
59
 
60
+ # 파일을 열어 JSON 형식으로 읽기
61
+ with open(temp_filepath, 'r', encoding='utf-8') as json_file:
62
+ json_content = json.load(json_file)
63
+ # JSON 데이터를 문자열로 변환
64
+ json_string = json.dumps(json_content)
65
+ # 변환된 문자열을 리스트에 담아 반환
66
+ return [json_string]
67
 
68
 
69
  # 문서들을 처리하여 텍스트 청크로 나누는 함수입니다.