Skip to content

combining one chunk #901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions backend/src/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import google.auth
from src.shared.constants import MODEL_VERSIONS, PROMPT_TO_ALL_LLMs


def get_llm(model: str):
"""Retrieve the specified language model based on the model name."""
env_key = "LLM_MODEL_CONFIG_" + model
Expand Down Expand Up @@ -201,8 +200,8 @@ async def get_graph_document_list(
async def get_graph_from_llm(model, chunkId_chunkDoc_list, allowedNodes, allowedRelationship):

llm, model_name = get_llm(model)
#combined_chunk_document_list = get_combined_chunks(chunkId_chunkDoc_list)
combined_chunk_document_list = get_chunk_id_as_doc_metadata(chunkId_chunkDoc_list)
combined_chunk_document_list = get_combined_chunks(chunkId_chunkDoc_list)
#combined_chunk_document_list = get_chunk_id_as_doc_metadata(chunkId_chunkDoc_list)

if allowedNodes is None or allowedNodes=="":
allowedNodes =[]
Expand Down
2 changes: 1 addition & 1 deletion backend/src/shared/common_fn.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get_chunk_and_graphDocument(graph_document_list, chunkId_chunkDoc_list):
logging.info("creating list of chunks and graph documents in get_chunk_and_graphDocument func")
lst_chunk_chunkId_document=[]
for graph_document in graph_document_list:
for chunk_id in graph_document.source.metadata['chunk_id'] :
for chunk_id in graph_document.source.metadata['combined_chunk_ids'] :
lst_chunk_chunkId_document.append({'graph_doc':graph_document,'chunk_id':chunk_id})

return lst_chunk_chunkId_document
Expand Down