Tuchuanhuhuhu commited on
Commit
03f0627
1 Parent(s): 0a2de58

加快索引加载速度

Browse files
Files changed (1) hide show
  1. modules/llama_func.py +1 -1
modules/llama_func.py CHANGED
@@ -82,12 +82,12 @@ def construct_index(
82
  separator=separator,
83
  )
84
  index_name = get_index_name(file_src)
85
- documents = get_documents(file_src)
86
  if os.path.exists(f"./index/{index_name}.json"):
87
  logging.info("找到了缓存的索引文件,加载中……")
88
  return GPTSimpleVectorIndex.load_from_disk(f"./index/{index_name}.json")
89
  else:
90
  try:
 
91
  logging.debug("构建索引中……")
92
  index = GPTSimpleVectorIndex(
93
  documents, llm_predictor=llm_predictor, prompt_helper=prompt_helper
 
82
  separator=separator,
83
  )
84
  index_name = get_index_name(file_src)
 
85
  if os.path.exists(f"./index/{index_name}.json"):
86
  logging.info("找到了缓存的索引文件,加载中……")
87
  return GPTSimpleVectorIndex.load_from_disk(f"./index/{index_name}.json")
88
  else:
89
  try:
90
+ documents = get_documents(file_src)
91
  logging.debug("构建索引中……")
92
  index = GPTSimpleVectorIndex(
93
  documents, llm_predictor=llm_predictor, prompt_helper=prompt_helper