tlsgy commited on
Commit
4e58a89
ยท
1 Parent(s): c4dc4b7
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -50,15 +50,16 @@ def get_csv_file(docs):
50
  return data
51
 
52
  def get_json_file(docs):
 
53
  json_data = json.loads(docs)
54
  temp_dir = tempfile.TemporaryDirectory() # ์ž„์‹œ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
55
  temp_filepath = os.path.join(temp_dir.name, docs.name) # JSON ํŒŒ์ผ ๊ฒฝ๋กœ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
56
 
57
  with open(temp_filepath, "w") as json_file: # JSON ํŒŒ์ผ์„ ์“ฐ๊ธฐ ๋ชจ๋“œ๋กœ ์—ฝ๋‹ˆ๋‹ค.
58
  json.dump(json_data, json_file) # ๋ฐ์ดํ„ฐ๋ฅผ JSON ํŒŒ์ผ์— ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.
59
-
60
  loader = JSONLoader(
61
- file_path=temp_filepath,
62
  jq_schema='.messages[].content',
63
  text_content=False
64
  )
 
50
  return data
51
 
52
  def get_json_file(docs):
53
+ '''
54
  json_data = json.loads(docs)
55
  temp_dir = tempfile.TemporaryDirectory() # ์ž„์‹œ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
56
  temp_filepath = os.path.join(temp_dir.name, docs.name) # JSON ํŒŒ์ผ ๊ฒฝ๋กœ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
57
 
58
  with open(temp_filepath, "w") as json_file: # JSON ํŒŒ์ผ์„ ์“ฐ๊ธฐ ๋ชจ๋“œ๋กœ ์—ฝ๋‹ˆ๋‹ค.
59
  json.dump(json_data, json_file) # ๋ฐ์ดํ„ฐ๋ฅผ JSON ํŒŒ์ผ์— ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.
60
+ '''
61
  loader = JSONLoader(
62
+ file_content=docs,
63
  jq_schema='.messages[].content',
64
  text_content=False
65
  )