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

edit codes

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -35,7 +35,11 @@ def get_text_file(docs):
35
  temp_filepath2 = os.path.join(temp_dir2.name, docs.name) # μž„μ‹œ 파일 경둜λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€.
36
  with open(temp_filepath2, "wb") as f: # μž„μ‹œ νŒŒμΌμ„ λ°”μ΄λ„ˆλ¦¬ μ“°κΈ° λͺ¨λ“œλ‘œ μ—½λ‹ˆλ‹€.
37
  f.write(docs.getvalue()) # TXT λ¬Έμ„œμ˜ λ‚΄μš©μ„ μž„μ‹œ νŒŒμΌμ— μ”λ‹ˆλ‹€.
38
- text_loader = TextLoader(temp_filepath2) # Use your specific text loader here.
 
 
 
 
39
  text_data = text_loader.load() # Extract text using the loader.
40
  return text_data # μΆ”μΆœν•œ ν…μŠ€νŠΈλ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.
41
 
 
35
  temp_filepath2 = os.path.join(temp_dir2.name, docs.name) # μž„μ‹œ 파일 경둜λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€.
36
  with open(temp_filepath2, "wb") as f: # μž„μ‹œ νŒŒμΌμ„ λ°”μ΄λ„ˆλ¦¬ μ“°κΈ° λͺ¨λ“œλ‘œ μ—½λ‹ˆλ‹€.
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.
44
  return text_data # μΆ”μΆœν•œ ν…μŠ€νŠΈλ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.
45