BaRiDo commited on
Commit
303d925
·
verified ·
1 Parent(s): 72a6b8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -1,8 +1,14 @@
1
  import streamlit as st
2
  from rag import RAGinit, RAG_proximity_search
3
 
 
 
 
 
 
 
4
  # Initialize everything once at startup
5
- client, model, emb, chroma_collection, vector_index_properties, top_n = RAGinit()
6
 
7
  def main():
8
  st.title("RAG-based QA App")
 
1
  import streamlit as st
2
  from rag import RAGinit, RAG_proximity_search
3
 
4
+ # Wrap RAGinit() inside a function that shows a spinner
5
+ def load_resources():
6
+ with st.spinner("Loading resources..."):
7
+ client, model, emb, chroma_collection, vector_index_properties, top_n = RAGinit()
8
+ return client, model, emb, chroma_collection, vector_index_properties, top_n
9
+
10
  # Initialize everything once at startup
11
+ client, model, emb, chroma_collection, vector_index_properties, top_n = load_resources()
12
 
13
  def main():
14
  st.title("RAG-based QA App")