Spaces:
Build error
Build error
Download state_manager.py from ArturG9/Question_Answer_Bot_With_Your_Pdf: direct link, hf CLI and curl.
- Browser
- Download file 702 Bytes
-
https://huggingface.co/spaces/ArturG9/Question_Answer_Bot_With_Your_Pdf/resolve/main/state_manager.py
- Command line
-
hf download hf://spaces/ArturG9/Question_Answer_Bot_With_Your_Pdf/state_manager.py
-
curl -L -o state_manager.py https://huggingface.co/spaces/ArturG9/Question_Answer_Bot_With_Your_Pdf/resolve/main/state_manager.py
702 Bytes
| from langchain.vectorstores import Chroma | |
| from langchain.chat_models import ChatOpenAI | |
| from langchain.chains import ConversationalRetrievalChain | |
| class StateManager: | |
| def __init__(self): | |
| self.vectorstore = None | |
| self.conversation_chain = None | |
| def create_vectorstore(self, text_chunks): | |
| self.vectorstore = self.get_vectorstore(text_chunks) | |
| def create_conversation_chain(self): | |
| self.conversation_chain = self.get_conversation_chain() | |
| def get_vectorstore(self, text_chunks): | |
| # Your existing get_vectorstore function logic | |
| pass | |
| def get_conversation_chain(self): | |
| # Your existing get_conversation_chain function logic | |
| pass |