Tuchuanhuhuhu commited on
Commit
279c854
·
1 Parent(s): ccade22

更新llama_index版本,bugfix

Browse files
Files changed (2) hide show
  1. modules/base_model.py +7 -4
  2. requirements.txt +1 -1
modules/base_model.py CHANGED
@@ -373,13 +373,16 @@ class BaseLLMModel:
373
  reply_language="中文",
374
  ):
375
  logging.debug("重试中……")
376
- if len(self.history) == 0:
 
 
 
 
 
 
377
  yield chatbot, f"{STANDARD_ERROR_MSG}上下文是空的"
378
  return
379
 
380
- inputs = self.history[-2]["content"]
381
- del self.history[-2:]
382
- self.all_token_counts.pop()
383
  iter = self.predict(
384
  inputs,
385
  chatbot,
 
373
  reply_language="中文",
374
  ):
375
  logging.debug("重试中……")
376
+ if len(self.history) > 0:
377
+ inputs = self.history[-2]["content"]
378
+ del self.history[-2:]
379
+ self.all_token_counts.pop()
380
+ elif len(chatbot) > 0:
381
+ inputs = chatbot[-1][0]
382
+ else:
383
  yield chatbot, f"{STANDARD_ERROR_MSG}上下文是空的"
384
  return
385
 
 
 
 
386
  iter = self.predict(
387
  inputs,
388
  chatbot,
requirements.txt CHANGED
@@ -7,7 +7,7 @@ tqdm
7
  colorama
8
  duckduckgo_search
9
  Pygments
10
- llama_index==0.5.5
11
  langchain
12
  markdown
13
  PyPDF2
 
7
  colorama
8
  duckduckgo_search
9
  Pygments
10
+ llama_index==0.5.13
11
  langchain
12
  markdown
13
  PyPDF2