[email protected] commited on
Commit
14b71a9
Β·
1 Parent(s): 79c9471

edit codes

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -37,7 +37,7 @@ def get_text_file(docs):
37
  f.write(docs.getvalue()) # TXT λ¬Έμ„œμ˜ λ‚΄μš©μ„ μž„μ‹œ νŒŒμΌμ— μ”λ‹ˆλ‹€.
38
  text_loader = TextLoader(
39
  file_path=temp_filepath2,
40
- txt_schema=' ',
41
  text_content=False
42
  ) # Use your specific text loader here.
43
  text_data = text_loader.load() # Extract text using the loader.
@@ -49,17 +49,17 @@ def get_csv_file(docs):
49
  with open(temp_filepath3, "wb") as f:
50
  f.write(docs.getvalue())
51
 
52
- csv_data = []
53
- with open(temp_filepath3, "r") as csv_file:
54
- csv_reader = csv.reader(csv_file)
55
- for row in csv_reader:
56
- csv_data.append(row)
57
- # csv_loader = CSVLoader(
58
- # file_path=temp_filepath3,
59
- # cs_schema='.messages[].content',
60
- # text_content=False
61
- # )
62
- # csv_data = csv_loader.load()
63
  return csv_data
64
 
65
  def get_json_file(docs):
 
37
  f.write(docs.getvalue()) # TXT λ¬Έμ„œμ˜ λ‚΄μš©μ„ μž„μ‹œ νŒŒμΌμ— μ”λ‹ˆλ‹€.
38
  text_loader = TextLoader(
39
  file_path=temp_filepath2,
40
+ txt_schema='',
41
  text_content=False
42
  ) # Use your specific text loader here.
43
  text_data = text_loader.load() # Extract text using the loader.
 
49
  with open(temp_filepath3, "wb") as f:
50
  f.write(docs.getvalue())
51
 
52
+ # csv_data = []
53
+ # with open(temp_filepath3, "r") as csv_file:
54
+ # csv_reader = csv.reader(csv_file)
55
+ # for row in csv_reader:
56
+ # csv_data.append(row)
57
+ csv_loader = CSVLoader(
58
+ file_path=temp_filepath3,
59
+ cs_schema='.data[].address',
60
+ text_content=False
61
+ )
62
+ csv_data = csv_loader.load()
63
  return csv_data
64
 
65
  def get_json_file(docs):