Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: list index out of range 出现这个问题程序就不可用了 #366

Open
2 tasks done
PHPSJ opened this issue May 27, 2024 · 6 comments
Open
2 tasks done

Comments

@PHPSJ
Copy link

PHPSJ commented May 27, 2024

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

  • 我已经搜索过已有的issues和讨论 | I have searched the existing issues / discussions

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

  • 我已经搜索过FAQ | I have searched FAQ

当前行为 | Current Behavior

Traceback (most recent call last):
File "handle_request", line 132, in handle_request
"_asgi_lifespan",
File "/usr/local/miniconda3/lib/python3.10/site-packages/sanic/response/types.py", line 547, in stream
await self.streaming_fn(self)
File "/usr/QAnything/qanything_kernel/qanything_server/handler.py", line 398, in generate_answer
async for resp, next_history in local_doc_qa.get_knowledge_based_answer(custom_prompt=custom_prompt,
File "/usr/QAnything/qanything_kernel/core/local_doc_qa.py", line 262, in get_knowledge_based_answer
retrieval_documents = await self.retrieve(query, kb_ids, need_web_search=need_web_search)
File "/usr/QAnything/qanything_kernel/core/local_doc_qa.py", line 246, in retrieve
retrieval_documents = await self.local_doc_search(query, kb_ids)
File "/usr/QAnything/qanything_kernel/core/local_doc_qa.py", line 128, in local_doc_search
retrieval_documents = self.rerank_documents(query, retrieval_documents)
File "/usr/QAnything/qanything_kernel/core/local_doc_qa.py", line 238, in rerank_documents
scores = self.local_rerank_backend.predict(query, [doc.page_content for doc in source_documents])
File "/usr/QAnything/qanything_kernel/utils/general_utils.py", line 73, in inner
res = func(*arg, **kwargs)
File "/usr/QAnything/qanything_kernel/connector/rerank/rerank_backend.py", line 91, in predict
tot_batches, merge_inputs_idxs_sort = self.tokenize_preproc(query, passages)
File "/usr/QAnything/qanything_kernel/connector/rerank/rerank_backend.py", line 70, in tokenize_preproc
qp_merge_inputs = self.merge_inputs(query_inputs, passage_inputs)
File "/usr/QAnything/qanything_kernel/connector/rerank/rerank_backend.py", line 46, in merge_inputs
chunk1['attention_mask'].append(chunk2['attention_mask'][0])
IndexError: list index out of range

期望行为 | Expected Behavior

No response

运行环境 | Environment

Python

QAnything日志 | QAnything logs

No response

复现方法 | Steps To Reproduce

No response

备注 | Anything else?

No response

@xmuyoucai
Copy link

遇到同样的问题

@chong-w
Copy link

chong-w commented Jun 3, 2024

加一,关键是偶尔出现,还不好复现,想debug都没得搞

@wang-yutao
Copy link

加一,很闹心,希望赶紧解决😭😭😭

@CHENyuuuuuuu
Copy link

我也出现了这个问题

@exlazybobby
Copy link

加一

1 similar comment
@liweiyang2023
Copy link

加一

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants