Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -84,12 +84,6 @@ def embed_documents_into_vectorstore(chunks, model_name, persist_directory):
|
|
| 84 |
vectorstore.add_documents(chunks)
|
| 85 |
return vectorstore
|
| 86 |
|
| 87 |
-
# Setup LLM
|
| 88 |
-
def setup_llm(model_name, temperature, api_key):
|
| 89 |
-
llm = ChatGroq(model=model_name, temperature=temperature, api_key=api_key)
|
| 90 |
-
return llm
|
| 91 |
-
|
| 92 |
-
|
| 93 |
def rag_workflow(query):
|
| 94 |
"""
|
| 95 |
RAGChain class to perform the complete RAG workflow.
|
|
@@ -145,7 +139,7 @@ def initialize():
|
|
| 145 |
|
| 146 |
filename = "test"
|
| 147 |
vector_store = embed_documents_into_vectorstore(doc_chunks + code_chunks, EMBEDDING_MODEL_NAME, f"{DATA_DIR}/{filename}")
|
| 148 |
-
llm =
|
| 149 |
|
| 150 |
from langchain_community.document_loaders import TextLoader
|
| 151 |
|
|
|
|
| 84 |
vectorstore.add_documents(chunks)
|
| 85 |
return vectorstore
|
| 86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
def rag_workflow(query):
|
| 88 |
"""
|
| 89 |
RAGChain class to perform the complete RAG workflow.
|
|
|
|
| 139 |
|
| 140 |
filename = "test"
|
| 141 |
vector_store = embed_documents_into_vectorstore(doc_chunks + code_chunks, EMBEDDING_MODEL_NAME, f"{DATA_DIR}/{filename}")
|
| 142 |
+
llm = get_groq_llm(LLM_MODEL_NAME, LLM_TEMPERATURE, GROQ_API_KEY)
|
| 143 |
|
| 144 |
from langchain_community.document_loaders import TextLoader
|
| 145 |
|