ankit75100 commited on
Commit
03e70a5
1 Parent(s): 8191f7f

Update Text2sql.py

Browse files
Files changed (1) hide show
  1. Text2sql.py +3 -1
Text2sql.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  from langchain import HuggingFaceHub
2
  from langchain import SQLDatabase
3
  from langchain_experimental.sql.base import SQLDatabaseSequentialChain
@@ -10,7 +12,7 @@ llm = HuggingFaceHub(repo_id="juierror/flan-t5-text2sql-with-schema-v2",
10
  model_kwargs={"temperature":overal_temperature,
11
  "max_new_tokens":200}
12
  )
13
- sqlite_db_path = "C:/Users/ankitkumar.singh/Desktop/streamlit/test_db.db"
14
  db1 = SQLDatabase.from_uri(f"sqlite:///{sqlite_db_path}")
15
  include_tables=['Employee','Album','Artist','Customer'],
16
  db_chain = SQLDatabaseChain.from_llm(llm, db1, verbose=True, return_direct=True)
 
1
+ from huggingface_hub import HfFileSystem
2
+ fs = HfFileSystem()
3
  from langchain import HuggingFaceHub
4
  from langchain import SQLDatabase
5
  from langchain_experimental.sql.base import SQLDatabaseSequentialChain
 
12
  model_kwargs={"temperature":overal_temperature,
13
  "max_new_tokens":200}
14
  )
15
+ sqlite_db_path = "hf://datasets/ankit75100/Ankit/test_db.db"
16
  db1 = SQLDatabase.from_uri(f"sqlite:///{sqlite_db_path}")
17
  include_tables=['Employee','Album','Artist','Customer'],
18
  db_chain = SQLDatabaseChain.from_llm(llm, db1, verbose=True, return_direct=True)