Text-2-Sql Llama3 #21423
Replies: 2 comments 3 replies
-
The error you're encountering, indicated by For instance, if you're working with embedding vectors or any array-like data in your SQL commands, you should ensure they're formatted correctly. A common mistake in LangChain's SQL generation could be formatting arrays as: vecs_str = "[" + ",".join(map(str, vecs)) + "]" For PostgreSQL, the correct format would be: vecs_str = "{" + ",".join(map(str, vecs)) + "}" Adjusting the array formatting to match your SQL dialect's requirements is crucial. If you're using a different database system, you'll need to adapt the formatting accordingly. For debugging, consider using LangChain's functionalities like If the problem persists, please share more details about the SQL query being generated and passed to the
|
Beta Was this translation helpful? Give feedback.
-
@quartermaine Did you find solution for your question ? |
Beta Was this translation helpful? Give feedback.
-
Checked other resources
Commit to Help
Example Code
Description
I'm attempting to utilize the template provided in the Langchain repository for text-to-SQL retrieval using Llama3. Here's the link to the template: Langchain SQL LlamaCPP Template.
But I am getting the following error
| sqlalchemy.exc.ProgrammingError: (psycopg2.errors.SyntaxError) syntax error at or near "20" | LINE 1: 20,5NUT" | ^ | | [SQL: 20,5NUT"] | (Background on this error at: https://sqlalche.me/e/20/f405)
System Info
output of my pip freeze in my anaconda environment
Beta Was this translation helpful? Give feedback.
All reactions