Fix dsn_or_db_path in readme
Hi @amard33p thank you for your contribution. However please add an additional line where it should say that the path could either be a local sqlite file or it could be an URI which you just changed. You can add the explanation in the comments.
Hi @Anindyadeep ...updated the PR.
Hi @Anindyadeep ...updated the PR.
Hi, thanks could you also add a third way of adding which is a local SQLite file. Because that is also something available. So just add that too on the comments in one or two comment sentence.
Do you mean like this: dsn_or_db_path = "./data/db/california_schools.sqlite" ?
This is not working for me...it throws error:
---------------------------------------------------------------------------
ArgumentError Traceback (most recent call last)
<ipython-input-3-b68b462c8a8b> in <cell line: 9>()
7 dsn_or_db_path = "test.db"
8
----> 9 agent = SimpleText2SQLAgent(
10 dsn_or_db_path=dsn_or_db_path,
11 generator=Text2SQLGeneratorHF(
6 frames
/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/url.py in _parse_url(name)
906
907 else:
--> 908 raise exc.ArgumentError(
909 "Could not parse SQLAlchemy URL from string '%s'" % name
910 )
ArgumentError: Could not parse SQLAlchemy URL from string 'test.db'
Here's the code I am using:
from premsql.pipelines import SimpleText2SQLAgent
from premsql.generators import Text2SQLGeneratorHF
from premsql.executors import SQLiteExecutor
from langchain_community.utilities.sql_database import SQLDatabase
dsn_or_db_path = "test.db"
agent = SimpleText2SQLAgent(
dsn_or_db_path=dsn_or_db_path,
generator=Text2SQLGeneratorHF(
model_or_name_or_path="premai-io/prem-1B-SQL",
experiment_name="simple_pipeline",
device="cuda:0",
type="test"
),
)
Ahh, I see, is the path of the DB correct? If it is, could you put an issue (having the same code and the error), I would like to check on that.
Hi, Thank you for the PR, but since there came a major update and the whole pipeline code has been removed with a new module called agents (will release soon). So I am closing this PR. Thanks