Update app.py
Browse files
app.py
CHANGED
|
@@ -581,20 +581,9 @@ class GEOSEOApp:
|
|
| 581 |
|
| 582 |
def main():
|
| 583 |
"""Main entry point"""
|
| 584 |
-
if "rag_chain" not in st.session_state
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
base_docs = [Document(page_content="This is a placeholder document for RAG initialization.")]
|
| 588 |
-
|
| 589 |
-
vectorstore = create_vectorstore_from_text(base_docs, HuggingFaceEmbeddings(
|
| 590 |
-
model_name="sentence-transformers/all-MiniLM-L6-v2",
|
| 591 |
-
model_kwargs={"device": "cpu"},
|
| 592 |
-
cache_folder="./hf_cache",
|
| 593 |
-
))
|
| 594 |
-
st.session_state.rag_chain = create_rag_chain(
|
| 595 |
-
ChatGroq(api_key=os.getenv("GROQ_API_KEY", "your-groq-api-key"), model_name="llama3-8b-8192", temperature=0.1),
|
| 596 |
-
vectorstore
|
| 597 |
-
)
|
| 598 |
app = GEOSEOApp()
|
| 599 |
app.run()
|
| 600 |
if __name__ == "__main__":
|
|
|
|
| 581 |
|
| 582 |
def main():
|
| 583 |
"""Main entry point"""
|
| 584 |
+
if "rag_chain" not in st.session_state:
|
| 585 |
+
st.session_state.rag_chain = None
|
| 586 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 587 |
app = GEOSEOApp()
|
| 588 |
app.run()
|
| 589 |
if __name__ == "__main__":
|