Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -83,11 +83,12 @@ class ChatDocumentQA:
|
|
83 |
Returns:
|
84 |
List[str]: List of smaller text chunks.
|
85 |
"""
|
86 |
-
text_splitter = CharacterTextSplitter(separator="\n", chunk_size=
|
87 |
|
88 |
chunks = text_splitter.split_documents(text)
|
89 |
|
90 |
return chunks
|
|
|
91 |
def _create_vector_store_from_text_chunks(self, text_chunks: List[str]) -> FAISS:
|
92 |
"""Create a vector store from text chunks.
|
93 |
|
@@ -211,7 +212,7 @@ class ChatDocumentQA:
|
|
211 |
|
212 |
def create_agent_chain_for_csv_qa(self,memory,tools,prompt):
|
213 |
|
214 |
-
llm_chain = LLMChain(llm=AzureChatOpenAI(azure_deployment = "
|
215 |
agent = ZeroShotAgent(llm_chain=llm_chain, tools=tools, verbose=True)
|
216 |
agent_chain = AgentExecutor.from_agent_and_tools(
|
217 |
agent=agent, tools=tools, verbose=True, memory=memory
|
|
|
83 |
Returns:
|
84 |
List[str]: List of smaller text chunks.
|
85 |
"""
|
86 |
+
text_splitter = CharacterTextSplitter(separator="\n", chunk_size=6000, chunk_overlap=0, length_function=len)
|
87 |
|
88 |
chunks = text_splitter.split_documents(text)
|
89 |
|
90 |
return chunks
|
91 |
+
|
92 |
def _create_vector_store_from_text_chunks(self, text_chunks: List[str]) -> FAISS:
|
93 |
"""Create a vector store from text chunks.
|
94 |
|
|
|
212 |
|
213 |
def create_agent_chain_for_csv_qa(self,memory,tools,prompt):
|
214 |
|
215 |
+
llm_chain = LLMChain(llm=AzureChatOpenAI(azure_deployment = "GPT-4"), prompt=prompt)
|
216 |
agent = ZeroShotAgent(llm_chain=llm_chain, tools=tools, verbose=True)
|
217 |
agent_chain = AgentExecutor.from_agent_and_tools(
|
218 |
agent=agent, tools=tools, verbose=True, memory=memory
|