Superduper: Integrate AI models and machine learning workflows with your database to implement custom AI applications, without moving your data. Including streaming inference, scalable model hosting, training and vector search.
AssertionError Traceback (most recent call last)
Cell In[11], line 5
2 from superduperdb import VectorIndex
4 # Add a VectorIndex to the SuperDuperDB database with the specified identifier and indexing listener
----> 5 _ = db.add(
6 VectorIndex(
7 identifier='my-index', # Unique identifier for the VectorIndex
8 indexing_listener=listener # Listener to be used for indexing documents
9 )
10 )
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/datalayer.py:846, in Datalayer._add(self, object, dependencies, parent)
844 artifacts = [leaf for leaf in leaves if isinstance(leaf, _BaseEncodable)]
845 children = [leaf for leaf in leaves if isinstance(leaf, Component)]
--> 846 jobs.extend(self._add_child_components(children, parent=object))
848 # need to do this again to get the versions of the children
849 object.set_variables(self)
File ~/Desktop/superduperDB/superduperdb/superduperdb/components/model.py:491, in Model.predict_in_db_job(self, X, db, predict_id, select, ids, max_chunk_size, dependencies, in_memory, overwrite)
463 """
464 Execute a single prediction on a datapoint
465 given by positional and keyword arguments as a job.
(...)
474 :param overwrite: Overwrite all documents or only new documents
475 """
476 job = ComponentJob(
477 component_identifier=self.identifier,
478 method_name='predict_in_db',
(...)
489 compute_kwargs=self.compute_kwargs,
490 )
--> 491 job(db, dependencies=dependencies)
492 return job
File ~/Desktop/superduperDB/superduperdb/superduperdb/jobs/job.py:217, in ComponentJob.call(self, db, dependencies)
215 db.metadata.create_job(self.dict())
216 if self.component is None:
--> 217 self.component = db.load(self.type_id, self.component_identifier)
218 self.submit(dependencies=dependencies)
219 return self
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/datalayer.py:575, in Datalayer.load(self, type_id, identifier, version, allow_hidden, info_only)
566 type_id = 'datatype'
568 info = self.metadata.get_component(
569 type_id=type_id,
570 identifier=identifier,
571 version=version,
572 allow_hidden=allow_hidden,
573 )
--> 575 info = Document.decode(info, db=self)
577 if info is None:
578 raise exceptions.MetadataException(
579 f'No such object of type "{type_id}", '
580 f'"{identifier}" has been registered.'
581 )
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/document.py:133, in _decode(r, db)
131 return [_decode(x, db=db) for x in r]
132 elif isinstance(r, dict):
--> 133 return {k: _decode(v, db=db) for k, v in r.items()}
134 else:
135 return r
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/document.py:133, in (.0)
131 return [_decode(x, db=db) for x in r]
132 elif isinstance(r, dict):
--> 133 return {k: _decode(v, db=db) for k, v in r.items()}
134 else:
135 return r
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/document.py:133, in _decode(r, db)
131 return [_decode(x, db=db) for x in r]
132 elif isinstance(r, dict):
--> 133 return {k: _decode(v, db=db) for k, v in r.items()}
134 else:
135 return r
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/document.py:133, in (.0)
131 return [_decode(x, db=db) for x in r]
132 elif isinstance(r, dict):
--> 133 return {k: _decode(v, db=db) for k, v in r.items()}
134 else:
135 return r
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/document.py:129, in _decode(r, db)
127 leaf_type = r['_content']['leaf_type']
128 leaf_cls = _LEAF_TYPES.get(leaf_type) or find_leaf_cls(leaf_type)
--> 129 return leaf_cls.decode(r, db=db)
130 elif isinstance(r, list):
131 return [_decode(x, db=db) for x in r]
File ~/Desktop/superduperDB/superduperdb/superduperdb/components/component.py:187, in Component.decode(cls, r, db, reference)
185 assert db is not None
186 r = r['_content']
--> 187 assert r['version'] is not None
188 return db.load(r['type_id'], r['identifier'], r['version'], allow_hidden=True)
Contact Details [Optional]
makkarss929@gmail.com
System Information
What happened?
AssertionError Traceback (most recent call last) Cell In[11], line 5 2 from superduperdb import VectorIndex 4 # Add a VectorIndex to the SuperDuperDB database with the specified identifier and indexing listener ----> 5 _ = db.add( 6 VectorIndex( 7 identifier='my-index', # Unique identifier for the VectorIndex 8 indexing_listener=listener # Listener to be used for indexing documents 9 ) 10 )
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/datalayer.py:478, in Datalayer.add(self, object, dependencies) 470 return type(object)( 471 self._add( 472 object=component, (...) 475 for component in object 476 ) 477 elif isinstance(object, Component): --> 478 return self._add(object=object, dependencies=dependencies), object 479 else: 480 return self._add(superduper(object)), object
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/datalayer.py:846, in Datalayer._add(self, object, dependencies, parent) 844 artifacts = [leaf for leaf in leaves if isinstance(leaf, _BaseEncodable)] 845 children = [leaf for leaf in leaves if isinstance(leaf, Component)] --> 846 jobs.extend(self._add_child_components(children, parent=object)) 848 # need to do this again to get the versions of the children 849 object.set_variables(self)
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/datalayer.py:806, in Datalayer._add_child_components(self, components, parent) 802 component = lookup[n] 803 dependencies = sum( 804 [jobs.get(d[:2], []) for d in component.dependencies], [] 805 ) --> 806 tmp = self._add( 807 component, parent=parent.unique_id, dependencies=dependencies 808 ) 809 jobs[n] = tmp 811 return sum(list(jobs.values()), [])
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/datalayer.py:861, in Datalayer._add(self, object, dependencies, parent) 859 object.post_create(self) 860 self._add_component_to_cache(object) --> 861 these_jobs = object.schedule_jobs(self, dependencies=dependencies) 862 jobs.extend(these_jobs) 863 return jobs
File ~/Desktop/superduperDB/superduperdb/superduperdb/components/listener.py:177, in Listener.schedule_jobs(self, db, dependencies, overwrite) 173 return [] 174 assert not isinstance(self.model, str) 176 out = [ --> 177 self.model.predict_in_db_job( 178 X=self.key, 179 db=db, 180 predict_id=f'{self.identifier}::{self.version}', 181 select=self.select.copy(), 182 dependencies=dependencies, 183 overwrite=overwrite, 184 ) 185 ] 186 return out
File ~/Desktop/superduperDB/superduperdb/superduperdb/components/model.py:491, in Model.predict_in_db_job(self, X, db, predict_id, select, ids, max_chunk_size, dependencies, in_memory, overwrite) 463 """ 464 Execute a single prediction on a datapoint 465 given by positional and keyword arguments as a job. (...) 474 :param overwrite: Overwrite all documents or only new documents 475 """ 476 job = ComponentJob( 477 component_identifier=self.identifier, 478 method_name='predict_in_db', (...) 489 compute_kwargs=self.compute_kwargs, 490 ) --> 491 job(db, dependencies=dependencies) 492 return job
File ~/Desktop/superduperDB/superduperdb/superduperdb/jobs/job.py:217, in ComponentJob.call(self, db, dependencies) 215 db.metadata.create_job(self.dict()) 216 if self.component is None: --> 217 self.component = db.load(self.type_id, self.component_identifier) 218 self.submit(dependencies=dependencies) 219 return self
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/datalayer.py:575, in Datalayer.load(self, type_id, identifier, version, allow_hidden, info_only) 566 type_id = 'datatype' 568 info = self.metadata.get_component( 569 type_id=type_id, 570 identifier=identifier, 571 version=version, 572 allow_hidden=allow_hidden, 573 ) --> 575 info = Document.decode(info, db=self) 577 if info is None: 578 raise exceptions.MetadataException( 579 f'No such object of type "{type_id}", ' 580 f'"{identifier}" has been registered.' 581 )
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/document.py:76, in Document.decode(r, db) 71 @staticmethod 72 def decode( 73 r: t.Dict, 74 db: t.Optional['Datalayer'] = None, 75 ) -> t.Any: ---> 76 decoded = _decode(dict(r), db=db) 77 if isinstance(decoded, dict): 78 return Document(decoded)
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/document.py:133, in _decode(r, db) 131 return [_decode(x, db=db) for x in r] 132 elif isinstance(r, dict): --> 133 return {k: _decode(v, db=db) for k, v in r.items()} 134 else: 135 return r
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/document.py:133, in(.0)
131 return [_decode(x, db=db) for x in r]
132 elif isinstance(r, dict):
--> 133 return {k: _decode(v, db=db) for k, v in r.items()}
134 else:
135 return r
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/document.py:133, in _decode(r, db) 131 return [_decode(x, db=db) for x in r] 132 elif isinstance(r, dict): --> 133 return {k: _decode(v, db=db) for k, v in r.items()} 134 else: 135 return r
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/document.py:133, in(.0)
131 return [_decode(x, db=db) for x in r]
132 elif isinstance(r, dict):
--> 133 return {k: _decode(v, db=db) for k, v in r.items()}
134 else:
135 return r
File ~/Desktop/superduperDB/superduperdb/superduperdb/base/document.py:129, in _decode(r, db) 127 leaf_type = r['_content']['leaf_type'] 128 leaf_cls = _LEAF_TYPES.get(leaf_type) or find_leaf_cls(leaf_type) --> 129 return leaf_cls.decode(r, db=db) 130 elif isinstance(r, list): 131 return [_decode(x, db=db) for x in r]
File ~/Desktop/superduperDB/superduperdb/superduperdb/components/component.py:187, in Component.decode(cls, r, db, reference) 185 assert db is not None 186 r = r['_content'] --> 187 assert r['version'] is not None 188 return db.load(r['type_id'], r['identifier'], r['version'], allow_hidden=True)
AssertionError:
Steps to reproduce
1. 2. 3. ...
Relevant log output
No response