From 507a87b3d050ebbeecbdfd4bc55879462b7ac73e Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 11 May 2025 13:29:51 +0800 Subject: [PATCH] . --- llama_index/indices/loading.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/llama_index/indices/loading.py b/llama_index/indices/loading.py index ed2a74c..d129191 100644 --- a/llama_index/indices/loading.py +++ b/llama_index/indices/loading.py @@ -25,9 +25,6 @@ def load_index_from_storage( **kwargs: Additional keyword args to pass to the index constructors. """ - # 使用 kwargs 获取 service_context - service_context = kwargs.get('service_context', None) - index_ids: Optional[Sequence[str]] if index_id is None: @@ -35,7 +32,7 @@ def load_index_from_storage( else: index_ids = [index_id] - indices = load_indices_from_storage(storage_context, index_ids=index_ids, service_context=service_context, **kwargs) + indices = load_indices_from_storage(storage_context, index_ids=index_ids, **kwargs) if len(indices) == 0: raise ValueError( @@ -67,8 +64,8 @@ def load_indices_from_storage( # 使用 kwargs 获取 service_context service_context = kwargs.get('service_context', None) - - + + if index_ids is None: logger.info("Loading all indices.") index_structs = storage_context.index_store.index_structs()