panda47 commited on
Commit
88204df
·
1 Parent(s): 3f137dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -49,13 +49,14 @@ def get_csv_file(csv_docs):
49
 
50
  def get_json_file(json_docs):
51
  temp_dir = tempfile.TemporaryDirectory()
 
 
 
52
  json_loader=JSONLoader(
53
  temp_filepath = os.path.join(temp_dir.name, json_docs.name),
54
  jq_schema='.messages[].content',
55
  text_content=False
56
  )
57
- with open(temp_filepath, "wb") as f:
58
- f.write(json_docs.getvalue())
59
  json_doc = json_loader.load()
60
  return json_doc
61
 
 
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
  temp_filepath = os.path.join(temp_dir.name, json_docs.name),
57
  jq_schema='.messages[].content',
58
  text_content=False
59
  )
 
 
60
  json_doc = json_loader.load()
61
  return json_doc
62