JinHyeong99 commited on
Commit
0a4e5b0
β€’
1 Parent(s): 5ae388f
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -13,9 +13,6 @@ from langchain.llms import HuggingFaceHub, LlamaCpp, CTransformers # For loadin
13
  from langchain.document_loaders import PyPDFLoader, TextLoader, JSONLoader, CSVLoader
14
  import tempfile # μž„μ‹œ νŒŒμΌμ„ μƒμ„±ν•˜κΈ° μœ„ν•œ λΌμ΄λΈŒλŸ¬λ¦¬μž…λ‹ˆλ‹€.
15
  import os
16
-
17
-
18
-
19
  # PDF λ¬Έμ„œλ‘œλΆ€ν„° ν…μŠ€νŠΈλ₯Ό μΆ”μΆœν•˜λŠ” ν•¨μˆ˜μž…λ‹ˆλ‹€.
20
  def get_pdf_text(pdf_docs):
21
  temp_dir = tempfile.TemporaryDirectory() # μž„μ‹œ 디렉토리λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€.
@@ -59,7 +56,8 @@ def get_json_file(json_docs):
59
 
60
  json_loader = JSONLoader(
61
  file_path = temp_filepath,
62
- jq_schema = '.'
 
63
  )
64
  json_doc = json_loader.load()
65
  return json_doc
 
13
  from langchain.document_loaders import PyPDFLoader, TextLoader, JSONLoader, CSVLoader
14
  import tempfile # μž„μ‹œ νŒŒμΌμ„ μƒμ„±ν•˜κΈ° μœ„ν•œ λΌμ΄λΈŒλŸ¬λ¦¬μž…λ‹ˆλ‹€.
15
  import os
 
 
 
16
  # PDF λ¬Έμ„œλ‘œλΆ€ν„° ν…μŠ€νŠΈλ₯Ό μΆ”μΆœν•˜λŠ” ν•¨μˆ˜μž…λ‹ˆλ‹€.
17
  def get_pdf_text(pdf_docs):
18
  temp_dir = tempfile.TemporaryDirectory() # μž„μ‹œ 디렉토리λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€.
 
56
 
57
  json_loader = JSONLoader(
58
  file_path = temp_filepath,
59
+ jq_schema = '.',
60
+ text_content=False
61
  )
62
  json_doc = json_loader.load()
63
  return json_doc