Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,6 +27,13 @@ import html
|
|
| 27 |
from streamlit_chat import message
|
| 28 |
import uuid
|
| 29 |
from dotenv import load_dotenv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
# Set page config
|
| 32 |
st.set_page_config(
|
|
@@ -147,9 +154,13 @@ def display_results(annotated_img, labels, objects, text):
|
|
| 147 |
st.session_state.analysis_results = {
|
| 148 |
"labels": labels,
|
| 149 |
"objects": objects,
|
| 150 |
-
"text": text
|
|
|
|
| 151 |
}
|
| 152 |
|
|
|
|
|
|
|
|
|
|
| 153 |
col1, col2 = st.columns([3, 2])
|
| 154 |
|
| 155 |
with col1:
|
|
|
|
| 27 |
from streamlit_chat import message
|
| 28 |
import uuid
|
| 29 |
from dotenv import load_dotenv
|
| 30 |
+
from langchain.embeddings import OpenAIEmbeddings
|
| 31 |
+
from langchain_groq import ChatGroq
|
| 32 |
+
from langchain.vectorstores import FAISS
|
| 33 |
+
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
| 34 |
+
from langchain.chains import ConversationalRetrievalChain
|
| 35 |
+
from langchain.memory import ConversationBufferMemory
|
| 36 |
+
from langchain.document_loaders import TextLoader
|
| 37 |
|
| 38 |
# Set page config
|
| 39 |
st.set_page_config(
|
|
|
|
| 154 |
st.session_state.analysis_results = {
|
| 155 |
"labels": labels,
|
| 156 |
"objects": objects,
|
| 157 |
+
"text": text,
|
| 158 |
+
"timestamp": time.strftime("%Y-%m-%d %H:%M:%S")
|
| 159 |
}
|
| 160 |
|
| 161 |
+
# Update vectorstore with new results
|
| 162 |
+
update_vectorstore_with_results(st.session_state.analysis_results)
|
| 163 |
+
|
| 164 |
col1, col2 = st.columns([3, 2])
|
| 165 |
|
| 166 |
with col1:
|