Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -286,8 +286,12 @@ def setup_vectorstore(chunks, model_name, persist_directory):
|
|
286 |
print("Start setup_vectorstore_function")
|
287 |
embedding_model = HuggingFaceEmbeddings(model_name=model_name)
|
288 |
vectorstore = Chroma.from_documents(chunks, embedding=embedding_model, persist_directory=persist_directory)
|
|
|
|
|
|
|
289 |
return vectorstore
|
290 |
|
|
|
291 |
# Setup LLM
|
292 |
def setup_llm(model_name, temperature, api_key):
|
293 |
llm = ChatGroq(model=model_name, temperature=temperature, api_key=api_key)
|
@@ -378,7 +382,7 @@ def initialize():
|
|
378 |
#print(f"Total number of code_chunks: {len(code_chunks)}")
|
379 |
print(f"Total number of doc_chunks: {len(doc_chunks)}")
|
380 |
|
381 |
-
docstore = setup_vectorstore(doc_chunks, EMBEDDING_MODEL_NAME,
|
382 |
#codestore = setup_vectorstore(code_chunks, EMBEDDING_MODEL_NAME, PERSIST_CODE_DIRECTORY)
|
383 |
|
384 |
#llm = setup_llm(LLM_MODEL_NAME, LLM_TEMPERATURE, GROQ_API_KEY)
|
|
|
286 |
print("Start setup_vectorstore_function")
|
287 |
embedding_model = HuggingFaceEmbeddings(model_name=model_name)
|
288 |
vectorstore = Chroma.from_documents(chunks, embedding=embedding_model, persist_directory=persist_directory)
|
289 |
+
|
290 |
+
#new
|
291 |
+
vectorstore.p
|
292 |
return vectorstore
|
293 |
|
294 |
+
|
295 |
# Setup LLM
|
296 |
def setup_llm(model_name, temperature, api_key):
|
297 |
llm = ChatGroq(model=model_name, temperature=temperature, api_key=api_key)
|
|
|
382 |
#print(f"Total number of code_chunks: {len(code_chunks)}")
|
383 |
print(f"Total number of doc_chunks: {len(doc_chunks)}")
|
384 |
|
385 |
+
docstore = setup_vectorstore(doc_chunks, EMBEDDING_MODEL_NAME, REPOSITORY_DIRECTORY )
|
386 |
#codestore = setup_vectorstore(code_chunks, EMBEDDING_MODEL_NAME, PERSIST_CODE_DIRECTORY)
|
387 |
|
388 |
#llm = setup_llm(LLM_MODEL_NAME, LLM_TEMPERATURE, GROQ_API_KEY)
|