mindnlp icon indicating copy to clipboard operation
mindnlp copied to clipboard

香橙派AI PRO(20T)上运行MindSpore NLP RAG Demo时遇到类型错误

Open maker-cxj opened this issue 9 months ago • 1 comments

Describe the bug/ 问题描述 (Mandatory / 必填) 在使用香橙派AI PRO(20T)运行MindSpore NLP的RAG Demo时,遇到了类型错误(TypeError)。具体错误信息为:对于primitive[Concat],输入[张量]元素应该具有相同的类型,但得到的是:Int64, Int32。

  • Hardware Environment(Ascend/GPU/CPU) / 硬件环境:

Please delete the backend not involved / 请删除不涉及的后端: /device ascend/CPU

  • Software Environment / 软件环境 (Mandatory / 必填): -- MindSpore version :2.4.10 -- Python version :3.9 -- OS platform and distribution (e.g., Linux Ubuntu 16.04):Ubuntu 22.04 -- CANN version:8.0.RC3.alpha002 -- MindSpore NLP version:master

  • Excute Mode / 执行模式 (Mandatory / 必填)(PyNative/Graph):

/mode pynative

To Reproduce / 重现步骤 (Mandatory / 必填) Steps to reproduce the behavior:

RAG demo by MindNLP+Langchain

1.#### Install dependencies pip install langchain langchain-community faiss-cpu 2.### Download knowledge file wget https://raw.githubusercontent.com/limchiahooi/nlp-chinese/master/%E8%A5%BF%E6%B8%B8%E8%AE%B0.txt -O xiyouji.txt 3.### Run RAG Demo streamlit run startup.py xiyouji.txt 4. See error

Expected behavior / 预期结果 (Mandatory / 必填) 预期结果应该是能够成功运行RAG Demo,输入问题后能够生成相应的答案,而不是遇到类型错误和API异常。

Screenshots/ 日志 / 截图 (Mandatory / 必填)

Image 运行报错.txt

Additional context / 备注 (Optional / 选填) 在运行过程中,还遇到了Streamlit API异常,提示st.text_area的高度无效。此外,错误日志中提到了多个警告和异常,包括NumPy的UserWarning和MindSpore的FutureWarning。

maker-cxj avatar Feb 22 '25 01:02 maker-cxj

看起来是输入dtype没对齐,可能是int32和int64一起concat了

lvyufeng avatar Feb 26 '25 03:02 lvyufeng