Skip to content

Can not get JINA CLIP v1 running #356

Closed Answered by decahedron1
SeanPedersen asked this question in Q&A
Discussion options

You must be logged in to vote

The input IDs need to be converted to something that can be cast into a tensor first.

This can be done by creating an Arc<Box<[i64]>> from the encoded tokens:

let mut tokens = Arc::new(tokens.get_ids().iter().map(|i| *i as i64).collect::<Vec<_>>().into_boxed_slice());

and passing a (Vec<i64>, Arc<Box<[i64]>>) as an input:

let input = (vec![1, 1, tokens.len() as i64], Arc::clone(&tokens));

The exact shape of the input tensor depends on what the model expects.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@decahedron1
Comment options

Answer selected by decahedron1
@SeanPedersen
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants