Spaces:
Sleeping
Sleeping
app.py
CHANGED
@@ -2,7 +2,7 @@ import streamlit as st
|
|
2 |
import random
|
3 |
import time
|
4 |
from index import build_index, build_service_context
|
5 |
-
from loader import load_documents
|
6 |
|
7 |
st.title("SAIRA")
|
8 |
|
@@ -14,7 +14,11 @@ def load_context():
|
|
14 |
return build_service_context()
|
15 |
|
16 |
context = load_context()
|
|
|
|
|
17 |
index = load_docs_and_build_index(context)
|
|
|
|
|
18 |
query_engine = index.as_query_engine(streaming=True)
|
19 |
|
20 |
# Initialize chat history
|
@@ -53,4 +57,4 @@ if prompt := st.chat_input("What is up?"):
|
|
53 |
message_placeholder.markdown(full_response + "▌")
|
54 |
message_placeholder.markdown(full_response)
|
55 |
# Add assistant response to chat history
|
56 |
-
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
|
|
2 |
import random
|
3 |
import time
|
4 |
from index import build_index, build_service_context
|
5 |
+
from loader import load_documents
|
6 |
|
7 |
st.title("SAIRA")
|
8 |
|
|
|
14 |
return build_service_context()
|
15 |
|
16 |
context = load_context()
|
17 |
+
|
18 |
+
print("Loading documents and building index...")
|
19 |
index = load_docs_and_build_index(context)
|
20 |
+
print("Done!")
|
21 |
+
|
22 |
query_engine = index.as_query_engine(streaming=True)
|
23 |
|
24 |
# Initialize chat history
|
|
|
57 |
message_placeholder.markdown(full_response + "▌")
|
58 |
message_placeholder.markdown(full_response)
|
59 |
# Add assistant response to chat history
|
60 |
+
st.session_state.messages.append({"role": "assistant", "content": full_response})
|