Pipelines - Model Primitives

Generate Text Embeddings

Call aidb.encode_text to generate a vector representation of a given text input.

select aidb.encode_text('t5', 'This is text I need vectorized.');

For batch inferencing, call `aidb.encode_text_batch.

select aidb.encode_text_batch('my_bert_model', ARRAY[
    'Dwayne "The Rock" Johnson',
    'Hatsune Miku',
    'Jim Lehrer',
    'Dikembe Mutombo'
])

Generate Image Embeddings

Call aidb.encode_image to generate a vector representation of a given image input.

-- BYTEA type casting included to demonstrate what data type is used
select aidb.encode_image('clip', image1 AS BYTEA);

For batch inferencing, call aidb.encode_image_batch:

-- BYTEA type casting included to demonstrate what data type is used
select aidb.encode_image_batch('my_bert_model', ARRAY[
    image_of_the_rock_cooking AS BYTEA,
    image_of_miku_singing AS BYTEA,
    image_of_jim_reporting_news AS BYTEA,
    image_mutombo_blocking_shots AS BYTEA
])

Generate Prompt Responses

Call aidb.decode_text to generate a prompt responses from a given text input.

select aidb.decode_text('t5', 'translate to german: hello world');

For batch inferencing, call aidb.decode_text_batch.

select aidb.decode_text_batch('my_bert_model', ARRAY[
    'translate to german: i am an example',
    'summarize: The missile knows where it is at all times. It knows this because it knows where it isn''t. By subtracting where it is from where it isn''t, or where it isn''t from where it is (whichever is greater), it obtains a difference, or deviation. The guidance subsystem uses deviations to generate corrective commands to drive the missile from a position where it is to a position where it isn''t, and arriving at a position where it wasn''t, it now is.'
]);

Could this page be better? Report a problem or suggest an addition!