Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Llama Index
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
run-llama
Llama Index
Commits
6cd92aff
Unverified
Commit
6cd92aff
authored
1 year ago
by
Logan
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix obj insert_nodes (#11836)
parent
84904839
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
llama-index-core/llama_index/core/indices/base.py
+8
-0
8 additions, 0 deletions
llama-index-core/llama_index/core/indices/base.py
llama-index-core/llama_index/core/indices/vector_store/base.py
+8
-0
8 additions, 0 deletions
...-index-core/llama_index/core/indices/vector_store/base.py
with
16 additions
and
0 deletions
llama-index-core/llama_index/core/indices/base.py
+
8
−
0
View file @
6cd92aff
...
@@ -217,6 +217,14 @@ class BaseIndex(Generic[IS], ABC):
...
@@ -217,6 +217,14 @@ class BaseIndex(Generic[IS], ABC):
def
insert_nodes
(
self
,
nodes
:
Sequence
[
BaseNode
],
**
insert_kwargs
:
Any
)
->
None
:
def
insert_nodes
(
self
,
nodes
:
Sequence
[
BaseNode
],
**
insert_kwargs
:
Any
)
->
None
:
"""
Insert nodes.
"""
"""
Insert nodes.
"""
for
node
in
nodes
:
if
isinstance
(
node
,
IndexNode
):
try
:
node
.
dict
()
except
ValueError
:
self
.
_object_map
[
node
.
index_id
]
=
node
.
obj
node
.
obj
=
None
with
self
.
_callback_manager
.
as_trace
(
"
insert_nodes
"
):
with
self
.
_callback_manager
.
as_trace
(
"
insert_nodes
"
):
self
.
docstore
.
add_documents
(
nodes
,
allow_update
=
True
)
self
.
docstore
.
add_documents
(
nodes
,
allow_update
=
True
)
self
.
_insert
(
nodes
,
**
insert_kwargs
)
self
.
_insert
(
nodes
,
**
insert_kwargs
)
...
...
This diff is collapsed.
Click to expand it.
llama-index-core/llama_index/core/indices/vector_store/base.py
+
8
−
0
View file @
6cd92aff
...
@@ -317,6 +317,14 @@ class VectorStoreIndex(BaseIndex[IndexDict]):
...
@@ -317,6 +317,14 @@ class VectorStoreIndex(BaseIndex[IndexDict]):
VectorStoreIndex only stores nodes in document store
VectorStoreIndex only stores nodes in document store
if vector store does not store text
if vector store does not store text
"""
"""
for
node
in
nodes
:
if
isinstance
(
node
,
IndexNode
):
try
:
node
.
dict
()
except
ValueError
:
self
.
_object_map
[
node
.
index_id
]
=
node
.
obj
node
.
obj
=
None
self
.
_insert
(
nodes
,
**
insert_kwargs
)
self
.
_insert
(
nodes
,
**
insert_kwargs
)
self
.
_storage_context
.
index_store
.
add_index_struct
(
self
.
_index_struct
)
self
.
_storage_context
.
index_store
.
add_index_struct
(
self
.
_index_struct
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment