ms-agent icon indicating copy to clipboard operation
ms-agent copied to clipboard

demo/demo_retrieval_agent.ipynb报错

Open XduSyL opened this issue 1 year ago • 6 comments

Initial Checks

  • [ ] I have searched GitHub for a duplicate issue and I'm sure this is something new
  • [ ] I have read and followed the docs & demos and still think this is a bug
  • [ ] I am confident that the issue is with modelscope-agent (not my code, or another library in the ecosystem)

What happened + What you expected to happen

作者您好,非常感谢您的工作 我在研究您的工作时,出现了一些问题,还请麻烦您解答一下 在运行demo/demo_retrieval_agent.ipynb的例子进行向量库检索时,在实例化memory类时报错了

memory = MemoryWithRetrievalKnowledge(storage_path=storage_path,
                                         name = memory_agent_name,
                                         memory_path=memory_history_path)

跳到了这一行

self.embedding = embedding or ModelScopeEmbeddings(
            model_id='damo/nlp_gte_sentence-embedding_chinese-base')

报了如下错误 Could not import some python packages.Please install it with pip install modelscope. ImportError: cannot import name 'models' from partially initialized module 'oss2' (most likely due to a circular import) (d:\Anaconda\envs\agent\lib\site-packages\oss2_init_.py)

The above exception was the direct cause of the following exception:

File "D:\Code\modelscope-agent\modelscope_agent\storage\vector_storage.py", line 30, in init self.embedding = embedding or ModelScopeEmbeddings( File "D:\Code\modelscope-agent\modelscope_agent\memory\memory_with_retrieval_knowledge.py", line 31, in init self.store_knowledge = KnowledgeVector( File "D:\Code\modelscope-agent\main.py", line 20, in memory = MemoryWithRetrievalKnowledge(storage_path=storage_path, ImportError: Could not import some python packages.Please install it with pip install modelscope.

Versions / Dependencies

Reproduction script

Issue Severity

None

XduSyL avatar Mar 19 '24 10:03 XduSyL

是否本地pip install modelscope

zzhangpurdue avatar Mar 19 '24 11:03 zzhangpurdue

是否本地pip install modelscope 在本地安装过modelscope了

XduSyL avatar Mar 19 '24 11:03 XduSyL

是否本地pip install modelscope

执行其他demo是正常的

XduSyL avatar Mar 19 '24 11:03 XduSyL

目前没法复现,可能的是,里面有些requirements出现了版本问题。你是完全跟据demo一行行执行下来的么?那个requirements.txt也是完整安装的么?

zzhangpurdue avatar Mar 19 '24 12:03 zzhangpurdue

请问一下在demo/demo_qwen_agent.ipynb的demo中,如果我要与大模型进行多轮会话的话要怎么操作呀,因为,我看RolePlay这个类实例化之后,最大执行次数默认为10,但是好像是单次就break了。

XduSyL avatar Mar 20 '24 11:03 XduSyL

这里的执行测试默认10,相当于他在做self-reflection,每一步他的结果他会去分析,还有什么不对的或者需要完善的,如果没有了,这一轮结束。也就是该单次聊天结束,需要多轮的话,参考这个链接

zzhangpurdue avatar Mar 20 '24 11:03 zzhangpurdue