Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,8 +11,6 @@ from langchain_openai import ChatOpenAI
|
|
| 11 |
from langchain.memory import ConversationBufferMemory
|
| 12 |
from langchain.chains import ConversationalRetrievalChain
|
| 13 |
|
| 14 |
-
import time
|
| 15 |
-
|
| 16 |
def getpdfdoc():
|
| 17 |
with st.spinner("Loading PDF..."):
|
| 18 |
filename = '48lawsofpower.pdf'
|
|
@@ -104,8 +102,6 @@ def main():
|
|
| 104 |
if os.path.isdir("./chroma_db"):
|
| 105 |
if os.listdir("./chroma_db"):
|
| 106 |
with st.spinner("Loading vector store..."):
|
| 107 |
-
st.markdown("VectorStore is readable")
|
| 108 |
-
time.sleep(10)
|
| 109 |
vectorstore = Chroma(persist_directory="./chroma_db", embedding_function=OpenAIEmbeddings())
|
| 110 |
st.session_state.conversation = get_conversation_chain(vectorstore)
|
| 111 |
else:
|
|
|
|
| 11 |
from langchain.memory import ConversationBufferMemory
|
| 12 |
from langchain.chains import ConversationalRetrievalChain
|
| 13 |
|
|
|
|
|
|
|
| 14 |
def getpdfdoc():
|
| 15 |
with st.spinner("Loading PDF..."):
|
| 16 |
filename = '48lawsofpower.pdf'
|
|
|
|
| 102 |
if os.path.isdir("./chroma_db"):
|
| 103 |
if os.listdir("./chroma_db"):
|
| 104 |
with st.spinner("Loading vector store..."):
|
|
|
|
|
|
|
| 105 |
vectorstore = Chroma(persist_directory="./chroma_db", embedding_function=OpenAIEmbeddings())
|
| 106 |
st.session_state.conversation = get_conversation_chain(vectorstore)
|
| 107 |
else:
|