jungwoo3490 commited on
Commit
b1e0d98
·
1 Parent(s): 6293c73

edit app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -31,7 +31,7 @@ def get_pdf_text(pdf_docs):
31
  def get_text_file(docs):
32
  temp_dir = tempfile.TemporaryDirectory()
33
  temp_filepath = os.path.join(temp_dir.name, docs.name)
34
- with open(temp_filepath, "w") as f:
35
  f.write(docs.getvalue())
36
  loader = TextLoader(temp_filepath)
37
  text_doc = loader.load()
@@ -41,7 +41,7 @@ def get_text_file(docs):
41
  def get_csv_file(csv_docs):
42
  temp_dir = tempfile.TemporaryDirectory()
43
  temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
44
- with open(temp_filepath, "w") as f:
45
  f.write(csv_docs.getvalue())
46
  loader = CSVLoader(temp_filepath)
47
  csv_doc = loader.load()
@@ -51,7 +51,7 @@ def get_csv_file(csv_docs):
51
  def get_json_file(json_docs):
52
  temp_dir = tempfile.TemporaryDirectory()
53
  temp_filepath = os.path.join(temp_dir.name, json_docs.name)
54
- with open(temp_filepath, "w") as f:
55
  f.write(json_docs.getvalue())
56
  loader = JSONLoader(temp_filepath, jq_schema="테스트")
57
  json_doc = loader.load()
 
31
  def get_text_file(docs):
32
  temp_dir = tempfile.TemporaryDirectory()
33
  temp_filepath = os.path.join(temp_dir.name, docs.name)
34
+ with open(temp_filepath, "wb") as f:
35
  f.write(docs.getvalue())
36
  loader = TextLoader(temp_filepath)
37
  text_doc = loader.load()
 
41
  def get_csv_file(csv_docs):
42
  temp_dir = tempfile.TemporaryDirectory()
43
  temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
44
+ with open(temp_filepath, "wb") as f:
45
  f.write(csv_docs.getvalue())
46
  loader = CSVLoader(temp_filepath)
47
  csv_doc = loader.load()
 
51
  def get_json_file(json_docs):
52
  temp_dir = tempfile.TemporaryDirectory()
53
  temp_filepath = os.path.join(temp_dir.name, json_docs.name)
54
+ with open(temp_filepath, "wb") as f:
55
  f.write(json_docs.getvalue())
56
  loader = JSONLoader(temp_filepath, jq_schema="테스트")
57
  json_doc = loader.load()