Created
December 2, 2021 02:58
-
-
Save nan-wang/e4a872ec40803eabbbcc6618a4eccb1d to your computer and use it in GitHub Desktop.
Try out TransformerTorchEncoder from Jina Hub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jina import Executor, Document, DocumentArray | |
encoder = Executor.from_hub('jinahub://TransformerTorchEncoder') | |
da = DocumentArray([ | |
Document(text='Jina is a neural search framework.'), | |
Document(text='Jina relies heavily on multiprocessing.'), | |
Document(text='Jina is backed by Jina AI.')]) | |
encoder.encode(docs=da) | |
for doc in da: | |
print(f'{doc.embedding}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment