JinHyeong99 commited on
Commit
7ec593e
Β·
1 Parent(s): 5e62047
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -48,15 +48,13 @@ def get_csv_file(csv_docs):
48
 
49
 
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
- 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='.[].text',
58
- text_content=False
59
- )
60
  json_doc = json_loader.load()
61
  return json_doc
62
 
 
48
 
49
 
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
+ 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=None)
 
 
58
  json_doc = json_loader.load()
59
  return json_doc
60