Created
August 26, 2022 04:43
-
-
Save lhr0909/e7e501cb8e4c2d17796dc7a48dc767c3 to your computer and use it in GitHub Desktop.
DIET Classifier PyTorch Snippets
This file contains hidden or 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 Flow | |
from docarray import DocumentArray, Document | |
from executor import DIETClassifierExecutor | |
f = Flow().add( | |
uses='jinahub+docker://ConveRTFeaturizer/latest' | |
).add( | |
uses=DIETClassifierExecutor, uses_with={ 'model_path': './lightning_logs/version_4/checkpoints/epoch=999-step=1000.ckpt' } | |
) | |
with f: | |
inputs = DocumentArray([Document(text='Naw man')]) | |
outputs: DocumentArray = f.post('/', inputs) | |
for doc in outputs: | |
doc.summary() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment