Git Product home page Git Product logo

history_rag's People

Contributors

betterandbetterii avatar chi-cat avatar codingjaguar avatar darius-gs avatar iamaaronyu avatar iouakira avatar leyiang avatar shiyu22 avatar taihaozesong avatar wxywb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

history_rag's Issues

[bug]关于比较大的文本输入构建索引失败

用2MB左右的文本已经成功构建了一个索引
但是在使用一个15MB左右的文本构建索引的时候连那个读条都没出来,就一直维持什么都没有的状态三个小时
所以是不是过于大的文本需要先分割好呢?

知识库构建索引出错

#32 情况不一样,服务器资源充足。

milvus 版本 2.3.3 , 使用 docker 部署。

存储情况如下:

[root@server volumes]# du ./ --max-depth=1 -h
367M	./etcd
8.9M	./minio
888M	./milvus
1.3G	./

运行情况如下:

[root@gpu-server milvus]# docker-compose ps
NAME                IMAGE                                      COMMAND                   SERVICE      CREATED       STATUS                 PORTS
attu                zilliz/attu:v2.3.2                         "docker-entrypoint.s…"   attu         6 hours ago   Up 6 hours             0.0.0.0:8000->3000/tcp, :::8000->3000/tcp
milvus-etcd         quay.io/coreos/etcd:v3.5.5                 "etcd -advertise-cli…"   etcd         6 hours ago   Up 6 hours (healthy)   2379-2380/tcp
milvus-minio        minio/minio:RELEASE.2023-03-20T20-16-18Z   "/usr/bin/docker-ent…"   minio        6 hours ago   Up 6 hours (healthy)   0.0.0.0:9000-9001->9000-9001/tcp, :::9000-9001->9000-9001/tcp
milvus-standalone   milvusdb/milvus:v2.3.3                     "/tini -- milvus run…"   standalone   6 hours ago   Up 6 hours (healthy)   0.0.0.0:19530->19530/tcp, :::19530->19530/tcp

错误日志如下:

[2024-03-21 20:43:06,020: ERROR/MainProcess] RPC error: [insert_rows], <DataNotMatchException: (code=1, message=Attempt to insert an unexpected field to collection without enabling dynamic field)>, <Time:{'RPC start': '2024-03-21 20:43:06.017347', 'RPC error': '2024-03-21 20:43:06.020646'}>
[2024-03-21 20:43:06,021: ERROR/MainProcess] Failed to insert batch starting at entity: 0/11
[2024-03-21 20:43:06,021: ERROR/MainProcess] Failed to insert batch starting at entity: 0/11
[2024-03-21 20:43:06,021: ERROR/MainProcess] consume document failed
Traceback (most recent call last):
  File "/app/api/core/indexing_runner.py", line 70, in run
    self._load(
  File "/app/api/core/indexing_runner.py", line 667, in _load
    index_processor.load(dataset, chunk_documents)
  File "/app/api/core/rag/index_processor/processor/paragraph_index_processor.py", line 59, in load
    vector.create(documents)
  File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 121, in create
    self._vector_processor.create(
  File "/app/api/core/rag/datasource/vdb/milvus/milvus_vector.py", line 75, in create
    self.add_texts(texts, embeddings)
  File "/app/api/core/rag/datasource/vdb/milvus/milvus_vector.py", line 101, in add_texts
    raise e
  File "/app/api/core/rag/datasource/vdb/milvus/milvus_vector.py", line 95, in add_texts
    ids = self._client.insert(collection_name=self._collection_name, data=batch_insert_list)
  File "/usr/local/lib/python3.10/site-packages/pymilvus/milvus_client/milvus_client.py", line 206, in insert
    raise ex from ex
  File "/usr/local/lib/python3.10/site-packages/pymilvus/milvus_client/milvus_client.py", line 198, in insert
    res = conn.insert_rows(collection_name, insert_batch, timeout=timeout)
  File "/usr/local/lib/python3.10/site-packages/pymilvus/decorators.py", line 127, in handler
    raise e from e
  File "/usr/local/lib/python3.10/site-packages/pymilvus/decorators.py", line 123, in handler
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/pymilvus/decorators.py", line 162, in handler
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/pymilvus/decorators.py", line 102, in handler
    raise e from e
  File "/usr/local/lib/python3.10/site-packages/pymilvus/decorators.py", line 68, in handler
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/pymilvus/client/grpc_handler.py", line 501, in insert_rows
    request = self._prepare_row_insert_request(
  File "/usr/local/lib/python3.10/site-packages/pymilvus/client/grpc_handler.py", line 482, in _prepare_row_insert_request
    return Prepare.row_insert_param(
  File "/usr/local/lib/python3.10/site-packages/pymilvus/client/prepare.py", line 422, in row_insert_param
    return cls._parse_row_request(request, fields_info, enable_dynamic, entities)
  File "/usr/local/lib/python3.10/site-packages/pymilvus/client/prepare.py", line 370, in _parse_row_request
    raise DataNotMatchException(message=ExceptionsMessage.InsertUnexpectedField)
pymilvus.exceptions.DataNotMatchException: <DataNotMatchException: (code=1, message=Attempt to insert an unexpected field to collection without enabling dynamic field)>
[2024-03-21 20:43:06,028: INFO/MainProcess] Processed dataset: bd66a1d2-d871-42c4-8fe7-4275be32a591 latency: 6.201149852946401
[2024-03-21 20:43:06,064: INFO/MainProcess] Task tasks.document_indexing_task.document_indexing_task[0df93ed7-9cae-4670-842d-8032b3d5852b] succeeded in 6.23699377477169s: None

win启动不了

win启动的时候报错:ImportError: cannot import name 'LLM' from 'llama_index.core.llms' (C:\ProgramData\Miniconda3\envs\history_rag-master\lib\site-packages\llama_index\core\llms_init_.py)
换了llama_index的版本还是不行

ValueError

选择milvus方案后出现:ValueError: Unrecognized model identifier in BAAI/bge-base-zh-v1.5. Should contains one of 'bert', 'openai-gpt', 'gpt2', 'transfo-xl', 'xlnet', 'xlm', 'roberta, 'ctrl'并直接退出
PixPin_2024-02-16_23-50-56

是否可以更换文本

大佬好,这是提的第二个Issue,之前提的已经解决了,史先生部署成功了,很有意义的一个项目。再次感谢!

问题:如何用您的项目代码构建一个新的知识库?

背景:我想更换为其他的语料,是不是意味着:我需要重新做一个milvus库?而不是:直接把txt文件丢到文件夹,build就好?

因为我这么做过,问相关的问题,答案就是:不知道。

所以想请教您:如何用您的项目代码构建一个新的知识库?谢谢!

ZS

运行 `python cli.py`时发生错误

你好。我的环境信息:操作系统:Windows 11
开发工具:VSCode
Python 版本:python-3.11.8
llama-index 版本:0.9.39

Issue: 在命令行模式下(powershell和cmd都是)运行 python cli.py时发生错误
ImportError: cannot import name 'ChatMessage' from 'llama_index.core.llms' (C:\Users\zhaos\AppData\Roaming\Python\Python311\site-packages\llama_index\core\llms_init_.py)

谢谢!
ZS

想使用代理的openai,该怎么办

请问如果我i使用的API不是直接连接到openai api而是经过中转的接口,调用前需要转换,在你的程序里需要修改哪里呢?

下面是中转站给的示例:
from openai import OpenAI

api_key = "xxx"
api_base = "https://one.aiskt.com/v1"
client = OpenAI(api_key=api_key, base_url=api_base)

completion = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
)

print(completion.choices[0].message)

Empty Response

image

我提出了问题,但返回Empty Response,这是为什么呢?

把模型换成gpt-3.5-turbo了,但是回答准确率比较低。

(rag) 问题: 张飞的妻子是谁?
张飞的妻子是后主敬哀皇后的长女。
+---------------------------------------------------------------------------------------------------------------------+

(rag) 问题: 后主敬哀皇后是谁?
后主敬哀皇后是车骑将军张飞的长女。
+---------------------------------------------------------------------------------------------------------------------+

小白遇到Milvus服务器的问题,恳请解答

大神你好,在执行python cli.py后,遇到如下问题,感觉是Milvus服务器没有运行,但自己在这方面知识储备几乎为0,请大神指教,多谢:
(rag) 选择[milvus|pipeline]方案
(rag) milvus
(rag) milvus模式已选择
1.使用build data/history_24/baihuasanguozhi.txt来进行知识库构建。
2.已有索引可以使用ask进行提问, -d参数以debug模式进入。
3.删除已有索引可以使用remove baihuasanguozhi.txt
(rag) ask
Failed to create new connection using: b1afc9fc359640d19a58706da83db8a4
Traceback (most recent call last):
File "/app/cli.py", line 120, in
cli.run()
File "/app/cli.py", line 53, in run
self.parse_input(command_text)
File "/app/cli.py", line 74, in parse_input
self.question_answer()
File "/app/cli.py", line 99, in question_answer
self._executor.build_query_engine()
File "/app/executor.py", line 196, in build_query_engine
self._get_index()
File "/app/executor.py", line 186, in _get_index
vector_store = MilvusVectorStore(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/llama_index/vector_stores/milvus.py", line 137, in init
self.milvusclient = MilvusClient(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pymilvus/milvus_client/milvus_client.py", line 59, in init
self._using = self._create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pymilvus/milvus_client/milvus_client.py", line 551, in _create_connection
raise ex from ex
File "/usr/local/lib/python3.11/site-packages/pymilvus/milvus_client/milvus_client.py", line 548, in _create_connection
connections.connect(using, user, password, db_name, token, uri=uri, **kwargs)
File "/usr/local/lib/python3.11/site-packages/pymilvus/orm/connections.py", line 414, in connect
connect_milvus(**kwargs, user=user, password=password, token=token, db_name=db_name)
File "/usr/local/lib/python3.11/site-packages/pymilvus/orm/connections.py", line 365, in connect_milvus
gh._wait_for_channel_ready(timeout=timeout)
File "/usr/local/lib/python3.11/site-packages/pymilvus/client/grpc_handler.py", line 146, in _wait_for_channel_ready
raise MilvusException(
pymilvus.exceptions.MilvusException: <MilvusException: (code=2, message=Fail connecting to server on localhost:19530. Timeout)>

想知道怎么转换txt到json

大佬好,我现在想从头clone你的项目,但是我难在第一步也就是数据导入上了,折腾了两个晚上仍然没有进展
zilliz要求文件是json格式但是你的数据全部是txt格式,想知道你是怎么转换的呢?

我按照官方给的教程运行了一遍,报错为primary_key is null也就是主键为空,以及调用的BulkWiter包报错,某个attribute不存在,不知道出了什么问题?

{BB60A83B-DACA-47ba-8DF0-87FBEBA63A2A}

非常期待你的回复!

文档分个模块和向量化

我这个地方很多的库的报错问题。请问您这里的文档分割是用的啥方法 在哪里可以看到呢。另外文本向量化的模型是啥 我这里报错的地方我都进不去看源码 期待回复
image

知识库构建索引出错,提示pymilvus.exceptions.DataNotMatchException: <DataNotMatchException: (code=1, message=Attempt to insert an unexpected field to collection without enabling dynamic field)>

当我成功连上milvus,并且执行 build data/history_24/baihuasanguozhi.txt命令后,进度条达到100%,报错

image
数据库不停的在报一个我不知道的错误
image
前面还报了一个好像是找不到索引的错误
image
数据库还有最上面的一堆错误
[2024/02/05 05:29:10.209 +00:00] [WARN] [grpcclient/client.go:516] ["ClientBase Call grpc call get error"] [role=proxy-2] [address=172.18.0.4:19529] [error="stack trace: /go/src/github.com/milvus-io/milvus/pkg/tracer/stack_trace.go:51 github.com/milvus-io/milvus/pkg/tracer.StackTrace\n/go/src/github.com/milvus-io/milvus/internal/util/grpcclient/client.go:515 github.com/milvus-io/milvus/internal/util/grpcclient.(*ClientBase[...]).Call\n/go/src/github.com/milvus-io/milvus/internal/util/grpcclient/client.go:529 github.com/milvus-io/milvus/internal/util/grpcclient.(*ClientBase[...]).ReCall\n/go/src/github.com/milvus-io/milvus/internal/distributed/proxy/client/client.go:76 github.com/milvus-io/milvus/internal/distributed/proxy/client.wrapGrpcCall[...]\n/go/src/github.com/milvus-io/milvus/internal/distributed/proxy/client/client.go:142 github.com/milvus-io/milvus/internal/distributed/proxy/client.(*Client).RefreshPolicyInfoCache\n/go/src/github.com/milvus-io/milvus/internal/rootcoord/proxy_client_manager.go:242 github.com/milvus-io/milvus/internal/rootcoord.(*proxyClientManager).RefreshPolicyInfoCache.func1\n/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 golang.org/x/sync/errgroup.(*Group).Go.func1\n/usr/local/go/src/runtime/asm_amd64.s:1598 runtime.goexit: attempt #0: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #1: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #2: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #3: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #4: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #5: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #6: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #7: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #8: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #9: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match"] [errorVerbose="stack trace: /go/src/github.com/milvus-io/milvus/pkg/tracer/stack_trace.go:51 github.com/milvus-io/milvus/pkg/tracer.StackTrace: attempt #0: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #1: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #2: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #3: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #4: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #5: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #6: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #7: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #8: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #9: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match\n(1) attached stack trace\n -- stack trace:\n | github.com/milvus-io/milvus/internal/util/grpcclient.(*ClientBase[...]).Call\n | \t/go/src/github.com/milvus-io/milvus/internal/util/grpcclient/client.go:515\n | [...repeated from below...]\nWraps: (2) stack trace: /go/src/github.com/milvus-io/milvus/pkg/tracer/stack_trace.go:51 github.com/milvus-io/milvus/pkg/tracer.StackTrace\n | /go/src/github.com/milvus-io/milvus/internal/util/grpcclient/client.go:515 github.com/milvus-io/milvus/internal/util/grpcclient.(*ClientBase[...]).Call\n | /go/src/github.com/milvus-io/milvus/internal/util/grpcclient/client.go:529 github.com/milvus-io/milvus/internal/util/grpcclient.(*ClientBase[...]).ReCall\n | /go/src/github.com/milvus-io/milvus/internal/distributed/proxy/client/client.go:76 github.com/milvus-io/milvus/internal/distributed/proxy/client.wrapGrpcCall[...]\n | /go/src/github.com/milvus-io/milvus/internal/distributed/proxy/client/client.go:142 github.com/milvus-io/milvus/internal/distributed/proxy/client.(*Client).RefreshPolicyInfoCache\n | /go/src/github.com/milvus-io/milvus/internal/rootcoord/proxy_client_manager.go:242 github.com/milvus-io/milvus/internal/rootcoord.(*proxyClientManager).RefreshPolicyInfoCache.func1\n | /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 golang.org/x/sync/errgroup.(*Group).Go.func1\n | /usr/local/go/src/runtime/asm_amd64.s:1598 runtime.goexit\nWraps: (3) attempt #0: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #1: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #2: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #3: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #4: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #5: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #6: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #7: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #8: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match\nWraps: (4) attached stack trace\n -- stack trace:\n | github.com/milvus-io/milvus/pkg/util/retry.Do\n | \t/go/src/github.com/milvus-io/milvus/pkg/util/retry/retry.go:49\n | github.com/milvus-io/milvus/internal/util/grpcclient.(*ClientBase[...]).call\n | \t/go/src/github.com/milvus-io/milvus/internal/util/grpcclient/client.go:429\n | github.com/milvus-io/milvus/internal/util/grpcclient.(*ClientBase[...]).Call\n | \t/go/src/github.com/milvus-io/milvus/internal/util/grpcclient/client.go:513\n | github.com/milvus-io/milvus/internal/util/grpcclient.(*ClientBase[...]).ReCall\n | \t/go/src/github.com/milvus-io/milvus/internal/util/grpcclient/client.go:529\n | github.com/milvus-io/milvus/internal/distributed/proxy/client.wrapGrpcCall[...]\n | \t/go/src/github.com/milvus-io/milvus/internal/distributed/proxy/client/client.go:76\n | github.com/milvus-io/milvus/internal/distributed/proxy/client.(*Client).RefreshPolicyInfoCache\n | \t/go/src/github.com/milvus-io/milvus/internal/distributed/proxy/client/client.go:142\n | github.com/milvus-io/milvus/internal/rootcoord.(*proxyClientManager).RefreshPolicyInfoCache.func1\n | \t/go/src/github.com/milvus-io/milvus/internal/rootcoord/proxy_client_manager.go:242\n | golang.org/x/sync/errgroup.(*Group).Go.func1\n | \t/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75\n | runtime.goexit\n | \t/usr/local/go/src/runtime/asm_amd64.s:1598\nWraps: (5) attempt #9\nWraps: (6) rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match\nError types: (1) *withstack.withStack (2) *errutil.withPrefix (3) merr.multiErrors (4) *withstack.withStack (5) *errutil.withPrefix (6) *status.Error"]
[2024/02/05 05:29:10.217 +00:00] [INFO] [rootcoord/root_coord.go:674] ["fail to refresh policy info cache"] [error="RefreshPolicyInfoCache failed, proxyID = 2, err = stack trace: /go/src/github.com/milvus-io/milvus/pkg/tracer/stack_trace.go:51 github.com/milvus-io/milvus/pkg/tracer.StackTrace\n/go/src/github.com/milvus-io/milvus/internal/util/grpcclient/client.go:515 github.com/milvus-io/milvus/internal/util/grpcclient.(*ClientBase[...]).Call\n/go/src/github.com/milvus-io/milvus/internal/util/grpcclient/client.go:529 github.com/milvus-io/milvus/internal/util/grpcclient.(*ClientBase[...]).ReCall\n/go/src/github.com/milvus-io/milvus/internal/distributed/proxy/client/client.go:76 github.com/milvus-io/milvus/internal/distributed/proxy/client.wrapGrpcCall[...]\n/go/src/github.com/milvus-io/milvus/internal/distributed/proxy/client/client.go:142 github.com/milvus-io/milvus/internal/distributed/proxy/client.(*Client).RefreshPolicyInfoCache\n/go/src/github.com/milvus-io/milvus/internal/rootcoord/proxy_client_manager.go:242 github.com/milvus-io/milvus/internal/rootcoord.(*proxyClientManager).RefreshPolicyInfoCache.func1\n/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 golang.org/x/sync/errgroup.(*Group).Go.func1\n/usr/local/go/src/runtime/asm_amd64.s:1598 runtime.goexit: attempt #0: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #1: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #2: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #3: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #4: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #5: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #6: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #7: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #8: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #9: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match"]
[2024/02/05 05:29:10.225 +00:00] [ERROR] [rootcoord/root_coord.go:670] ["retry func failed"] ["retry time"=0] [error="RefreshPolicyInfoCache failed, proxyID = 2, err = stack trace: /go/src/github.com/milvus-io/milvus/pkg/tracer/stack_trace.go:51 github.com/milvus-io/milvus/pkg/tracer.StackTrace\n/go/src/github.com/milvus-io/milvus/internal/util/grpcclient/client.go:515 github.com/milvus-io/milvus/internal/util/grpcclient.(*ClientBase[...]).Call\n/go/src/github.com/milvus-io/milvus/internal/util/grpcclient/client.go:529 github.com/milvus-io/milvus/internal/util/grpcclient.(*ClientBase[...]).ReCall\n/go/src/github.com/milvus-io/milvus/internal/distributed/proxy/client/client.go:76 github.com/milvus-io/milvus/internal/distributed/proxy/client.wrapGrpcCall[...]\n/go/src/github.com/milvus-io/milvus/internal/distributed/proxy/client/client.go:142 github.com/milvus-io/milvus/internal/distributed/proxy/client.(*Client).RefreshPolicyInfoCache\n/go/src/github.com/milvus-io/milvus/internal/rootcoord/proxy_client_manager.go:242 github.com/milvus-io/milvus/internal/rootcoord.(*proxyClientManager).RefreshPolicyInfoCache.func1\n/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 golang.org/x/sync/errgroup.(*Group).Go.func1\n/usr/local/go/src/runtime/asm_amd64.s:1598 runtime.goexit: attempt #0: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #1: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #2: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #3: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #4: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #5: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #6: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #7: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #8: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match: attempt #9: rpc error: code = Unknown desc = expectedNodeID=2, actualNodeID=3: node not match"] [stack="github.com/milvus-io/milvus/internal/rootcoord.(*Core).startInternal.func1\n\t/go/src/github.com/milvus-io/milvus/internal/rootcoord/root_coord.go:670"]
[2024/02/05 05:29:10.230 +00:00] [INFO] [rootcoord/proxy_client_manager.go:120] ["succeed to create proxy client"] [address=172.18.0.4:19529] [serverID=3]
[2024/02/05 05:29:10.230 +00:00] [INFO] [rootcoord/timeticksync.go:241] ["Remove session from timeticksync"] [serverID=2]
[2024/02/05 05:29:10.230 +00:00] [INFO] [rootcoord/proxy_client_manager.go:135] ["remove proxy client"] ["proxy address"=172.18.0.4:19529] ["proxy id"=2]
[2024/02/05 05:29:10.239 +00:00] [WARN] [rootcoord/quota_center.go:146] ["quotaCenter sync metrics failed"] [error="GetMetrics failed, proxyID = 3, err = context deadline exceeded"]
[2024/02/05 05:29:12.597 +00:00] [INFO] [datacoord/meta.go:1287] ["UpdateChannelCheckpoint done"] [vChannel=by-dev-rootcoord-dml_0_447391822218951197v0] [ts=447508892842983425] [msgID="\u0001\u0000dS\ufffd\ufffd5\u0006"] [time=2024/02/05 05:29:09.871 +00:00]
看起来好像是节点识别有问题,有没有遇到过的大佬帮忙解答下

Unknow Model 的问题

在运行
python cli.py
(rag) milvus
后就会出现这样的问题
wrong_1
wrong_2
图1是报错的信息,图2是获取的OPEN_AI_KEY
我在想是不是OPEN_AI_KEY的问题
请大佬解答

[bug]ValueError:Cannot use llm_chat_callback on an instance without a callback_manager attribute.

问题描述

按照项目中的 Windows 说明按步骤执行过程中,遇到了问题。

环境信息

  • 操作系统:Windows 11
  • 开发工具:VSCode
  • Python 版本:3.9.12
  • llama-index 版本:0.9.39

执行步骤列表

  1. clone项目到本地。

  2. 使用 .venv 创建虚拟环境——Python 版本是 3.9.12。

  3. pip——过程中,会自动安装最新版本的 llama-index(版本是 0.10.x)。

  4. pip——我手动升级为 0.9.39。

  5. 首次运行前——在 VSCode 下遇到了模块与文件名重名的情况,需要修改 3 处才能运行 python cli.py。修改的地方分别是:

    • from llama_index.core.query_pipeline.components import (...) (components模块下的components.py无法识别)

    • from llama_index.core.llms.llm import LLM(llm 模块下的llm.py无法识别)

    • from llama_index.core.llms.llm import ChatMessage, MessageRole

    • from llama_index.core import global_handler(llama_index.core模块下没有global_handler)

  6. build txt 过程没有遇到问题。

  7. 在执行 ask -d 过程中可以正确返回结果,但随后产生了 ValueError。

Traceback (most recent call last):
  File "C:\Users\A\VscodeProjects\history_rag\cli.py", line 120, in <module>
    cli.run()
  File "C:\Users\A\VscodeProjects\history_rag\cli.py", line 53, in run
    self.parse_input(command_text)
  File "C:\Users\A\VscodeProjects\history_rag\cli.py", line 74, in parse_input
    self.question_answer()
  File "C:\Users\A\VscodeProjects\history_rag\cli.py", line 109, in question_answer
    self.query(question)
  File "C:\Users\A\VscodeProjects\history_rag\cli.py", line 86, in query
    ans = self._executor.query(question)
  File "C:\Users\A\VscodeProjects\history_rag\executor.py", line 237, in query
    response = self.query_engine.query(question)
  File "c:\Users\A\VscodeProjects\history_rag\.venv\lib\site-packages\llama_index\core\base_query_engine.py", line 40, in query
    return self._query(str_or_query_bundle)
  File "c:\Users\A\VscodeProjects\history_rag\.venv\lib\site-packages\llama_index\query_engine\retriever_query_engine.py", line 172, in _query 
    response = self._response_synthesizer.synthesize(
  File "c:\Users\A\VscodeProjects\history_rag\.venv\lib\site-packages\llama_index\response_synthesizers\base.py", line 168, in synthesize      
    response_str = self.get_response(
  File "c:\Users\A\VscodeProjects\history_rag\.venv\lib\site-packages\llama_index\response_synthesizers\compact_and_refine.py", line 38, in get_response
    return super().get_response(
  File "c:\Users\A\VscodeProjects\history_rag\.venv\lib\site-packages\llama_index\response_synthesizers\refine.py", line 146, in get_response  
    response = self._give_response_single(
  File "c:\Users\A\VscodeProjects\history_rag\.venv\lib\site-packages\llama_index\response_synthesizers\refine.py", line 202, in _give_response_single
    program(
  File "c:\Users\A\VscodeProjects\history_rag\.venv\lib\site-packages\llama_index\response_synthesizers\refine.py", line 64, in __call__       
    answer = self._llm.predict(
  File "c:\Users\A\VscodeProjects\history_rag\.venv\lib\site-packages\llama_index\core\llms\llm_.py", line 239, in predict
    chat_response = self.chat(messages)
  File "c:\Users\A\VscodeProjects\history_rag\.venv\lib\site-packages\llama_index\core\llms\callbacks.py", line 84, in wrapped_llm_chat        
    with wrapper_logic(_self) as callback_manager:
  File "C:\Users\A\AppData\Local\Programs\Python\Python39\lib\contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "c:\Users\A\VscodeProjects\history_rag\.venv\lib\site-packages\llama_index\core\llms\callbacks.py", line 30, in wrapper_logic
    raise ValueError(
ValueError: Cannot use llm_chat_callback on an instance without a callback_manager attribute.

milvus连接出错

我已经配置了数据库连接地址和端口,并且测试过都是通的,通过自己写的连接工具可以连接上,但是这里到最后就会出现连接本地错误
image
刚开始以为是配置文件没有读取到,就打印出来,地址是对的,但还是显示连接localhost失败
image
下面是我的配置文件
image

输入ask后报错

索引已经生成过了,报错如下

`python3 cli.py
___ ___ _____ _ _ _ _____ _____ _____ _____ __ __
/ |/ | | _ \ | | | | | | / / | | / _ \ | _ \ \ \ / /
/ /| /| | | |
| | | |
| | | | | |
__ | | | | | | | || | \ / /
/ / |/ | | | _ / | _ | | | _ \ | | | | | | | _ / \ /
/ / | | | | \ \ | | | | | | | | | | | || | | | \ \ / /
/
/ |
| |
| _\ || || || /_____/ || ___/ || _\ //


  • Version:2.0 *

  • Author:Bruce Young *

(rag) 选择[milvus|pipeline]方案
(rag) milvus
(rag) milvus模式已选择
1.使用build data/history_24/baihuasanguozhi.txt来进行知识库构建。
2.已有索引可以使用ask进行提问, -d参数以debug模式进入。
3.删除已有索引可以使用remove baihuasanguozhi.txt
(rag) ask -d
Traceback (most recent call last):
File "/home/pushsoft/cywTest/history_rag/cli.py", line 120, in
cli.run()
File "/home/pushsoft/cywTest/history_rag/cli.py", line 53, in run
self.parse_input(command_text)
File "/home/pushsoft/cywTest/history_rag/cli.py", line 74, in parse_input
self.question_answer()
File "/home/pushsoft/cywTest/history_rag/cli.py", line 99, in question_answer
self._executor.build_query_engine()
File "/home/pushsoft/cywTest/history_rag/executor.py", line 201, in build_query_engine
self.query_engine = self.index.as_query_engine(node_postprocessors=[
File "/home/pushsoft/.local/lib/python3.10/site-packages/llama_index/indices/base.py", line 350, in as_query_engine
from llama_index.query_engine.retriever_query_engine import RetrieverQueryEngine
File "/home/pushsoft/.local/lib/python3.10/site-packages/llama_index/query_engine/init.py", line 27, in
from llama_index.query_engine.router_query_engine import (
File "/home/pushsoft/.local/lib/python3.10/site-packages/llama_index/query_engine/router_query_engine.py", line 24, in
from llama_index.selectors.utils import get_selector_from_context
File "/home/pushsoft/.local/lib/python3.10/site-packages/llama_index/selectors/init.py", line 3, in
from llama_index.selectors.pydantic_selectors import (
File "/home/pushsoft/.local/lib/python3.10/site-packages/llama_index/selectors/pydantic_selectors.py", line 10, in
from llama_index.program.openai_program import OpenAIPydanticProgram
File "/home/pushsoft/.local/lib/python3.10/site-packages/llama_index/program/init.py", line 5, in
from llama_index.program.openai_program import OpenAIPydanticProgram
File "/home/pushsoft/.local/lib/python3.10/site-packages/llama_index/program/openai_program.py", line 4, in
from llama_index.agent.openai.utils import resolve_tool_choice
File "/home/pushsoft/.local/lib/python3.10/site-packages/llama_index/agent/init.py", line 2, in
from llama_index.agent.custom.pipeline_worker import QueryPipelineAgentWorker
File "/home/pushsoft/.local/lib/python3.10/site-packages/llama_index/agent/custom/pipeline_worker.py", line 27, in
from llama_index.query_pipeline.components.agent import (
File "/home/pushsoft/.local/lib/python3.10/site-packages/llama_index/query_pipeline/init.py", line 24, in
from llama_index.query_pipeline.query import InputKeys, OutputKeys, QueryPipeline
File "/home/pushsoft/.local/lib/python3.10/site-packages/llama_index/query_pipeline/query.py", line 7, in
import networkx
File "/usr/local/lib/python3.10/dist-packages/networkx/init.py", line 20, in
from networkx.utils.backends import _dispatch
File "/usr/local/lib/python3.10/dist-packages/networkx/utils/backends.py", line 132, in
backends = _get_backends("networkx.plugins")
File "/usr/local/lib/python3.10/dist-packages/networkx/utils/backends.py", line 106, in _get_backends
items = entry_points(group=group)
File "/usr/lib/python3.10/importlib/metadata/init.py", line 1021, in entry_points
return SelectableGroups.load(eps).select(**params)
File "/usr/lib/python3.10/importlib/metadata/init.py", line 459, in load
ordered = sorted(eps, key=by_group)
File "/usr/lib/python3.10/importlib/metadata/init.py", line 1018, in
eps = itertools.chain.from_iterable(
File "/usr/lib/python3.10/importlib/metadata/_itertools.py", line 16, in unique_everseen
k = key(element)
File "/usr/lib/python3.10/importlib/metadata/init.py", line 943, in _normalized_name
or super().normalized_name
File "/usr/lib/python3.10/importlib/metadata/init.py", line 622, in normalized_name
return Prepared.normalize(self.name)
File "/usr/lib/python3.10/importlib/metadata/init.py", line 871, in normalize
return re.sub(r"[-
.]+", "-", name).lower().replace('-', '
')
File "/usr/lib/python3.10/re.py", line 209, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like objec`

能有一个从零部署的说明吗?

可以增加一个windows从零开始部署的说明吗?我用了一天总算勉强把milvus搞出来了。现在按命令看是有milvus-etcd、milvus-minio、milvus-standalone,也安装了最新的python,但是其他的步骤应该怎么操作?
Clip_2024-01-29_13-31-50

下载本地模型后依旧报错Connection error. OSError: [Errno 101] Network is unreachable

发生异常: APIConnectionError
Connection error.
OSError: [Errno 101] Network is unreachable
During handling of the above exception, another exception occurred:
httpcore.ConnectError: [Errno 101] Network is unreachable
The above exception was the direct cause of the following exception:
httpx.ConnectError: [Errno 101] Network is unreachable
During handling of the above exception, another exception occurred:
OSError: [Errno 101] Network is unreachable
During handling of the above exception, another exception occurred:
httpcore.ConnectError: [Errno 101] Network is unreachable
The above exception was the direct cause of the following exception:
httpx.ConnectError: [Errno 101] Network is unreachable
During handling of the above exception, another exception occurred:
OSError: [Errno 101] Network is unreachable
During handling of the above exception, another exception occurred:
httpcore.ConnectError: [Errno 101] Network is unreachable
The above exception was the direct cause of the following exception:
httpx.ConnectError: [Errno 101] Network is unreachable
During handling of the above exception, another exception occurred:
OSError: [Errno 101] Network is unreachable
During handling of the above exception, another exception occurred:
httpcore.ConnectError: [Errno 101] Network is unreachable
The above exception was the direct cause of the following exception:
httpx.ConnectError: [Errno 101] Network is unreachable
The above exception was the direct cause of the following exception:
File "/home/ureka/history_rag-master/executor.py", line 241, in query
response = self.query_engine.query(question)
File "/home/ureka/history_rag-master/cli.py", line 89, in query
ans = self._executor.query(question)
File "/home/ureka/history_rag-master/cli.py", line 112, in question_answer
self.query(question)
File "/home/ureka/history_rag-master/cli.py", line 77, in parse_input
self.question_answer()
File "/home/ureka/history_rag-master/cli.py", line 56, in run
self.parse_input(command_text)
File "/home/ureka/history_rag-master/cli.py", line 123, in
cli.run()
openai.APIConnectionError: Connection error.

在 HF 部署一个 demo?

您好,这个项目太棒了,是否考虑来 HF 弄一个 demo 吗?这样很多没有技术背景的同学也都可以直接用起来啦~

可以用类似 https://huggingface.co/spaces/fastx/Gpt-4-chatbot 这里的方式让大家输入自己的 API key 我们应该也可以提供一些国内模型的 api token

我的微信: zhou_a_zhou

祝好~
铁震

[Feature Requests] 关于WebUI与返回检索内容的需求

  1. 后期有打算提供web ui嘛?目前在wsl环境会出现ANSI 转义序列的问题,可以通过import readline解决,但是还是不够好看
  2. 能否只返回topk的chunk(检索得到的原文内容),不进行llm具体调用?
  3. 可以在FAQ里列一下一般一个问题的价格?我个人实测GPT4 turbo的价格在每个问题0.05$左右

运行时提示ImportError: ('Cannot import sentence-transformers or torch package,', 'please `pip install torch sentence-transformers`')

已经安装了sentence-transformers==2.5.0torch==2.2.1但是仍然提示无法导入

('Cannot import sentence-transformers or torch package,', 'please pip install torch sentence-transformers')
ModuleNotFoundError: No module named 'sentence_transformers'
During handling of the above exception, another exception occurred:
File "/home/ureka/history_rag-master/executor.py", line 145, in init
self.rerank_postprocessor = SentenceTransformerRerank(
File "/home/ureka/history_rag-master/cli.py", line 30, in run
self._executor = MilvusExecutor(conf)
File "/home/ureka/history_rag-master/cli.py", line 120, in
cli.run()
ImportError: ('Cannot import sentence-transformers or torch package,', 'please pip install torch sentence-transformers')

pipeline方案使用qwen作为LLM时,无法正常使用

用qwen作为LLM,用命令python cli.py --cfg cfgs/config_qwen.yaml启动,使用mlivus方案是正常的,但是使用pipeline方案的时候调用的模型却是LlamaIndex默认的gpt-3.5-turbo。请问这个问题怎么解决呢,期待您的回复,谢谢您。
image

ImportError: cannot import name 'ServiceContext' from 'llama_index' (unknown location)

按照步骤安装完成,运行时报错:
(history-rag) ubuntu@SKTech-Shanghai:/var/www/history_rag$ python cli.py --cfg cfgs/config_qwen.yaml
Traceback (most recent call last):
File "/var/www/history_rag/cli.py", line 1, in
from executor import MilvusExecutor
File "/var/www/history_rag/executor.py", line 12, in
from llama_index import ServiceContext, StorageContext
ImportError: cannot import name 'ServiceContext' from 'llama_index' (unknown location)

关于非历史文本的输入

我想利用这个模型做一个别的知识领域的rag。但是我改了提示词和build的文本。如下:

文本:
When Madison was growing up, she was a difficult child. “She was very

intense and moody. She would flip at the switch of the light—unpre�dictable. When she was good, she was very good, but when she would

have those episodes of in-your-face hostility, living with her was very

hard.” Madison, as described by her mother, was very intelligent and was

in the gifted and talented program. She excelled in high school and

但是ask后显示Empty Response,debug后发现这个文本没有build上。故想请问如何操作能build上。

Error Code 429

各位好,我尝试在Windows环境下搭设,其他都已经部署完毕,但到提问环节时就会出现如图问题。已经修改gpt4为3.5,且能查询到API Key。因为没有任何计算机基础,所以万望不吝赐教!
image
image
image

构建索引时报错,先前没有问题

image
已经建立过一次索引,后来想载入更多数据的时候,发现建立索引报错。
运行指令build https://raw.githubusercontent.com/wxywb/history_rag/master/data/history_24/baihuasanguozhi.txt
将zilliz上已经建立的表history_rag删除也依然无法添加
image
想问下RuntimeError: {'code': 90019, 'message': 'Pipeline server error: call server failed, msg=internal error'}
服务器这个状态码是什么意思,官方文档没有提及错误码的相关含义(国际版zilliz)

RuntimeError: {'code': 90019, 'message': 'Pipeline server error: call server failed, msg=internal error'}

➜ history_rag git:(master) ✗ python3 cli.py
___ ___ _____ _ _ _ _____ _____ _____ _____ __ __
/ |/ | | _ \ | | | | | | / / | | / _ \ | _ \ \ \ / /
/ /| /| | | |
| | | |
| | | | | |
__ | | | | | | | || | \ / /
/ / |/ | | | _ / | _ | | | _ \ | | | | | | | _ / \ /
/ / | | | | \ \ | | | | | | | | | | | || | | | \ \ / /
/
/ |
| |
| _\ || || || /_____/ || ___/ || _\ //


  • Version:2.0 *

  • Author:Bruce Young *

(rag) 选择[milvus|pipeline]方案
(rag) pipeline
Embeddings have been explicitly disabled. Using MockEmbedding.
(rag) pipeline模式已选择, 使用build https://raw.githubusercontent.com/wxywb/history_rag/master/data/history_24/baihuasanguozhi.txt来进行知识库构建。
1.使用build https://raw.githubusercontent.com/wxywb/history_rag/master/data/history_24/baihuasanguozhi.txt来进行知 识库构建。
2.已有索引可以使用ask进行提问, -d参数以debug模式进入。
3.删除已有索引可以使用remove baihuasanguozhi.txt
(rag) build https://raw.githubusercontent.com/Yi-Lyu/MyVimConfig/master/20240228.txt
Traceback (most recent call last):
File "/root/code/history_rag/cli.py", line 120, in
cli.run()
File "/root/code/history_rag/cli.py", line 53, in run
self.parse_input(command_text)
File "/root/code/history_rag/cli.py", line 65, in parse_input
self.build_index(path=commands[1], overwrite=False)
File "/root/code/history_rag/cli.py", line 92, in build_index
self._executor.build_index(path, overwrite)
File "/root/code/history_rag/executor.py", line 328, in build_index
self.index.insert_doc_url(
File "/root/code/history_rag/custom/zilliz/base.py", line 135, in insert_doc_url
raise RuntimeError(response_dict)
RuntimeError: {'code': 90019, 'message': 'Pipeline server error: call server failed, msg=internal error'}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.