Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tensor serialization #109

Closed
numb3r3 opened this issue Feb 10, 2022 · 2 comments
Closed

fix tensor serialization #109

numb3r3 opened this issue Feb 10, 2022 · 2 comments

Comments

@numb3r3
Copy link
Contributor

numb3r3 commented Feb 10, 2022

Maybe this problem due to the serialization of DA?

from jina import DocumentArray, Document, Flow
import numpy as np

docs = DocumentArray([Document(tensor=np.random.rand(224, 224))] * 100)
print(docs.summary())

with Flow(protocol='http').add() as flow:
    flow.post('/index', inputs=docs, show_progress=True)

with Flow(protocol='grpc').add() as flow:
    flow.post('/index', inputs=docs, show_progress=True)

yields

          Flow@96082[I]:🎉 Flow is ready to use!
	🔗 Protocol: 		HTTP
	🏠 Local access:	0.0.0.0:64451
	🔒 Private network:	192.168.31.35:64451
	💬 Swagger UI:		http://localhost:64451/docs
	📚 Redoc:		http://localhost:64451/redoc
⠼       DONE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸ 0:00:48 100% ETA: 0 seconds 80 steps done in 48 seconds
           Flow@96082[I]:🎉 Flow is ready to use!
	🔗 Protocol: 		GRPC
	🏠 Local access:	0.0.0.0:49305
	🔒 Private network:	192.168.31.35:49305
⠋       DONE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸ 0:00:00 100% ETA: 0 seconds 80 steps done in 0 seconds

We can observe that HTTP flow takes much more time.

@JoanFM
Copy link
Member

JoanFM commented Feb 10, 2022

I think there is very little to do about it.

@hanxiao
Copy link
Member

hanxiao commented Feb 10, 2022

closing as it is the wrong expectation of docarray. If client don't want embedding, they should not query embedding, eg. GraphQL

@hanxiao hanxiao closed this as completed Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants