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

插入一个文档后显示插入成功,但是提问相关的时候,会报错,每个框内都显示error,报错如下,请问怎么解决呢?还有就是文档是纯文本即可吗?需要构建具体格式吗比如json什么的? #10

Closed
adogwangwang opened this issue Oct 16, 2023 · 1 comment

Comments

@adogwangwang
Copy link

Traceback (most recent call last):
File "/opt/conda/lib/python3.10/site-packages/gradio/queueing.py", line 406, in call_prediction
output = await route_utils.call_process_api(
File "/opt/conda/lib/python3.10/site-packages/gradio/route_utils.py", line 226, in call_process_api
output = await app.get_blocks().process_api(
File "/opt/conda/lib/python3.10/site-packages/gradio/blocks.py", line 1554, in process_api
result = await self.call_function(
File "/opt/conda/lib/python3.10/site-packages/gradio/blocks.py", line 1206, in call_function
prediction = await utils.async_iteration(iterator)
File "/opt/conda/lib/python3.10/site-packages/gradio/utils.py", line 517, in async_iteration
return await iterator.anext()
File "/opt/conda/lib/python3.10/site-packages/gradio/utils.py", line 510, in anext
return await anyio.to_thread.run_sync(
File "/opt/conda/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/opt/conda/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "/opt/conda/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
File "/opt/conda/lib/python3.10/site-packages/gradio/utils.py", line 493, in run_sync_iterator_async
return next(iterator)
File "/opt/conda/lib/python3.10/site-packages/gradio/utils.py", line 647, in gen_wrapper
yield from f(*args, **kwargs)
File "/data/app/web.py", line 45, in predict
search_res = search_doc(question, search_method, top_k, knn_boost, threshold)
File "/data/app/web.py", line 23, in search_doc
res = es.doc_search(method=search_method, query=question, top_k=top_k, knn_boost=knn_boost)
File "/data/app/doc_search.py", line 131, in doc_search
'source': i['_source']['metadata']['source'],
KeyError: 'metadata'

@iMagist486
Copy link
Owner

#8 参考这个,检查下langchain版本;上传纯文本即可

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

2 participants