I am trying to run a local Llama 2 model against my SQL database on ubuntu. However, I'm encountering the following range error.
WARNING — 2024-03-07 03:27:38,715 — Minds Core — Function:ask_db — Line:498 — An unexpected error occurred: list index out of range
Res: {'error': 'list index out of range'}
from mindsql.core.mindsql_core import MindSQLCore
from mindsql.llms import LlamaCpp
from mindsql.databases import MySql
from mindsql.vectorstores import Faiss
config = {
"model_path": "/home/guitmonk/Downloads/llama-2-7b.Q3_K_L.gguf"
}
class MindSqlGenAI(Faiss, LlamaCpp, MySql):
def __init__(self, config=config):
Faiss.__init__(self, config=config)
LlamaCpp.__init__(self, config=config)
MySql.__init__(self, config=config)
minds = MindSqlGenAI(config=config)
connection = minds.create_connection(<SQL_URL>)
# Index DB Schmas
ddls = minds.get_all_ddls(connection=connection, database="test")
for ind in ddls.index:
minds.index_ddl(ddls["DDL"][ind])
# Provide Example query-SQL pairs
minds.index(bulk=False, path="examples.json")
# ask questions
res = minds.ask_db(question="How many total clients are there?", connection=connection)
print("Res: ", res)
connection.close()
I've tried to debug it but I'm not sure where is this error originating from.