inferencing embeddings models #10
arturborycki
started this conversation in
Ideas
Replies: 1 comment
-
|
Hi, this sounds like a very useful feature. Thanks for sharing it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I create working prototype that allow to also inference embeddings models base on text data as input, I was interested to see if this is something commuity is interested in adding to the infera extension, As I am not part of the core team I wanted to see if there is an interest in that aditional direction?
Example:
select infera_load_text_model('gte_model', 'https://huggingface.co/thenlper/gte-base/resolve/main/onnx/model.onnx', 'https://huggingface.co/thenlper/gte-base/resolve/main/tokenizer.json', 512);
with embeddings as (
select 'sentence1' as text, infera_predict_text('gte_model', 'This is a test sentence for embedding generation.') as embedding
union all
select 'sentence2' as text, infera_predict_text('gte_model', 'The quick brown fox jumps over the lazy dog.') as embedding
)
┌───────────┬───────┬────────────────────────────────────── ───────────────────────┐
│ text │ dim │ first_5_values │
│ varchar │ int64 │ float[] │
├───────────┼───────┼──────────────────────────────────────────────────────────────┤
│ sentence1 │ 768 │ [0.16316502, -0.49085385, 0.35360435, 0.77152574, 1.2055475] │
│ sentence2 │ 768 │ [-0.382681, -0.74655575, 0.41404557, 0.2588208, 0.9010632] │
└───────────┴───────┴──────────────────────────────────────────────────────────────┘
Beta Was this translation helpful? Give feedback.
All reactions