Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -22,8 +22,8 @@ from langchain.chains import LLMChain
|
|
22 |
from langchain_experimental.utilities.sql_database import SQLDatabase
|
23 |
from langchain_experimental.retrievers.sql_database import SQLDatabaseChainRetriever
|
24 |
from langchain_experimental.sql.base import SQLDatabaseChain
|
25 |
-
from langchain_experimental.sql.parser import VectorSQLRetrieveAllOutputParser
|
26 |
|
|
|
27 |
from chains.arxiv_chains import ArXivQAwithSourcesChain, ArXivStuffDocumentChain
|
28 |
from callbacks.arxiv_callbacks import ChatDataSelfSearchCallBackHandler, \
|
29 |
ChatDataSelfAskCallBackHandler, ChatDataSQLSearchCallBackHandler, \
|
@@ -155,7 +155,7 @@ def build_retriever():
|
|
155 |
template=_myscale_prompt,
|
156 |
)
|
157 |
|
158 |
-
output_parser =
|
159 |
model=embeddings)
|
160 |
sql_query_chain = SQLDatabaseChain.from_llm(
|
161 |
llm=OpenAI(openai_api_key=OPENAI_API_KEY, temperature=0),
|
|
|
22 |
from langchain_experimental.utilities.sql_database import SQLDatabase
|
23 |
from langchain_experimental.retrievers.sql_database import SQLDatabaseChainRetriever
|
24 |
from langchain_experimental.sql.base import SQLDatabaseChain
|
|
|
25 |
|
26 |
+
from chains.arxiv_chains import VectorSQLRetrieveCustomOutputParser
|
27 |
from chains.arxiv_chains import ArXivQAwithSourcesChain, ArXivStuffDocumentChain
|
28 |
from callbacks.arxiv_callbacks import ChatDataSelfSearchCallBackHandler, \
|
29 |
ChatDataSelfAskCallBackHandler, ChatDataSQLSearchCallBackHandler, \
|
|
|
155 |
template=_myscale_prompt,
|
156 |
)
|
157 |
|
158 |
+
output_parser = VectorSQLRetrieveCustomOutputParser.from_embeddings(
|
159 |
model=embeddings)
|
160 |
sql_query_chain = SQLDatabaseChain.from_llm(
|
161 |
llm=OpenAI(openai_api_key=OPENAI_API_KEY, temperature=0),
|