This PR adds the ability to pass models to specific ingredients via .from_args(model=model).
This passed model will take priority, and if no ingredient-level model is specified, we will fall back to the default_model given to the blend() function.
For example:
ingredients = {ImageCaption.from_args(model=vision_model), LLMMap}
res = blend(
query="""
SELECT "Name",
{{ImageCaption('parks::Image')}} as "Image Description",
{{
LLMMap(
question='Size in km2?',
context='parks::Area'
)
}} as "Size in km" FROM parks
WHERE "Location" = 'Alaska'
ORDER BY "Size in km" DESC LIMIT 1
""",
db=db,
default_model=text_model,
ingredients=ingredients,
)
Since LLMMap is not given a model in it's initialization, it will be fed the text_model at runtime. The new ImageCaption model, however, needs a TransformersVisionModel, so we pass it via the classmethod from_args.
This PR adds the ability to pass models to specific ingredients via
.from_args(model=model)
. This passed model will take priority, and if no ingredient-level model is specified, we will fall back to thedefault_model
given to theblend()
function.For example:
Since
LLMMap
is not given a model in it's initialization, it will be fed thetext_model
at runtime. The newImageCaption
model, however, needs aTransformersVisionModel
, so we pass it via the classmethodfrom_args
.Benchmark Runtimes
Closes #22