Getting CypherSyntaxError and ValueError when running GraphCypherQAChain on Hugginface LLM #17643
Replies: 3 comments 2 replies
-
🤖 Hey there, @KaifAhmad1! Great to see you back with another intriguing puzzle for us to crack together. 🛠️ The
To debug this issue, you should first check the generated Cypher query and the schema used for validation. If the issue persists, you should check the initialization parameters of the Regarding your question about the role of The The You can find more details in the source code of the GraphCypherQAChain class. I hope this helps! If you have any more questions or need further clarification, feel free to ask. Sources
|
Beta Was this translation helpful? Give feedback.
-
hospital_cypher_chain = GraphCypherQAChain.from_llm( model is ="mistralai/Mistral-7B-Instruct-v0.2" Generate Query , why include "Cypher statment": how can i remove it ,please provie me correct answer My OutPut and Error
Cypher statement: CypherSyntaxError Traceback (most recent call last) File ~/anaconda3/lib/python3.9/site-packages/neo4j/_sync/work/session.py:313, in Session.run(self, query, parameters, **kwargs) File ~/anaconda3/lib/python3.9/site-packages/neo4j/_sync/work/result.py:181, in Result._run(self, query, parameters, db, imp_user, access_mode, bookmarks, notifications_min_severity, notifications_disabled_categories) File ~/anaconda3/lib/python3.9/site-packages/neo4j/_sync/work/result.py:301, in Result._attach(self) File ~/anaconda3/lib/python3.9/site-packages/neo4j/_sync/io/_common.py:178, in ConnectionErrorHandler.getattr..outer..inner(*args, **kwargs) File ~/anaconda3/lib/python3.9/site-packages/neo4j/_sync/io/_bolt.py:850, in Bolt.fetch_message(self) File ~/anaconda3/lib/python3.9/site-packages/neo4j/_sync/io/_bolt5.py:369, in Bolt5x0._process_message(self, tag, fields) File ~/anaconda3/lib/python3.9/site-packages/neo4j/_sync/io/_common.py:245, in Response.on_failure(self, metadata) CypherSyntaxError: {code: Neo.ClientError.Statement.SyntaxError} {message: Invalid input 'statement': expected During handling of the above exception, another exception occurred: ValueError Traceback (most recent call last) File ~/anaconda3/lib/python3.9/site-packages/langchain/chains/base.py:163, in Chain.invoke(self, input, config, **kwargs) File ~/anaconda3/lib/python3.9/site-packages/langchain/chains/base.py:153, in Chain.invoke(self, input, config, **kwargs) File ~/anaconda3/lib/python3.9/site-packages/langchain/chains/graph_qa/cypher.py:268, in GraphCypherQAChain._call(self, inputs, run_manager) File ~/anaconda3/lib/python3.9/site-packages/langchain_community/graphs/neo4j_graph.py:252, in Neo4jGraph.query(self, query, params) ValueError: Generated Cypher Statement is not valid |
Beta Was this translation helpful? Give feedback.
-
Use the skip_prompt kwarg as shown here:
https://python.langchain.com/v0.2/docs/integrations/llms/huggingface_pipelines/#create-chain
V čet., 15. avg. 2024, 03:28 je oseba li-hhhh ***@***.***>
napisala:
… 请问你最后怎么解决的呀?我也遇到的这样的问题,谢谢
—
Reply to this email directly, view it on GitHub
<#17643 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEYGGTMLDOVAU3N42T6J4J3ZRP74XAVCNFSM6AAAAABDMGUZJ2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMZUGI4DKMI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
System Info
pip = 24.0
Cuda = 12.1
OS = Windows 11 x64
Beta Was this translation helpful? Give feedback.
All reactions