SuperDuperDB / superduperdb

🔮 SuperDuperDB: Bring AI to your database! Build, deploy and manage any AI application directly with your existing data infrastructure, without moving your data. Including streaming inference, scalable model training and vector search.
https://superduperdb.com
Apache License 2.0
4.55k stars 445 forks source link

Create components to ship easy to adapt applications #2114

Closed kartik4949 closed 1 month ago

kartik4949 commented 1 month ago

Description

fix #2115

Related Issues

Checklist

Additional Notes or Comments

blythed commented 1 month ago

A few things which don't work:

In [1]: t.encode() # compare to `t.dict().encode()` 
In [2]: db[Variables['bla']].find().variables # gives empty
In [3]: ...

Also please add these useful things to superduperdb/__init__.py (Variable, Template, Component, etc.)

blythed commented 1 month ago

Another bug:

m = ObjectModel(Variable(identifier='test'), object=lambda x: x + 2)
t = Template(component=m, identifier='my_template', info={'test': {'type': 'str'}})
db.apply(t)
mm = db.load('template', t.identifier)
mm.init(db)
mm.object
# <EMPTY>

I think that you need to work on the .init method of Template. First you would load the template from the artifact store. Then each artifact inside the template should be loaded.

blythed commented 1 month ago

Observation: print can crash program, if the contained Component.encode() is big.