jina-ai / jina

☁️ Build multimodal AI applications with cloud-native stack
https://docs.jina.ai
Apache License 2.0
20.87k stars 2.22k forks source link

Create first project in docs is outdated? #6007

Closed mvsoom closed 1 year ago

mvsoom commented 1 year ago

I'm on latest, pip install --pre jina with Python 3.9.2. I'm following Create first project tutorial. I think that page might be outdated?

jina cloud deploy ./ does not work for either Deployment or Flow choice at the top of the tutorial:

(.venv) marnix@hp:~/ART/CAMERA/code/hello-jina$ jina cloud deploy .
usage: jina cloud [-h] [-v]
                  [--loglevel {DEBUG, INFO, CRITICAL, NOTSET}]
                  {login, logout, flow, flows ... 5 more
                  choices} ...
jina cloud: error: argument jc_cli: invalid choice: 'deploy' (choose from 'login', 'logout', 'flow', 'flows', 'job', 'jobs', 'secret', 'secrets', 'new')

Also, the following code cell in the tutorial seems to make little sense for either Deployment or Flow choice

from jina import Client
from docarray import DocList
from docarray.documents.legacy import LegacyDocument

if __name__ == '__main__':
    c = Client(host='grpcs://1655d050ad.wolf.jina.ai')
    da = c.post('/crunch-numbers', DocList[LegacyDocument]([LegacyDocument(), LegacyDocument()]), return_type=DocList[LegacyDocument])
    print(da.tensor)

since it appears before deployment in jcloud.

mvsoom commented 1 year ago

Possibly related:

The client code at https://docs.jina.ai/concepts/preliminaries/ also doesn't work. The code belows does work:

from jina import Client
from docarray import DocList
from docarray.documents import TextDoc

c = Client(port=12345)

input = [TextDoc("")]

r = c.post(on='/', inputs=DocList[TextDoc](input), return_type=DocList[TextDoc])
print([d.text for d in r])

I am on prerelease to avoid warnings when importing jina.

mvsoom commented 1 year ago

Also doesn't work on latest jina (instead of prerelease).

JoanFM commented 1 year ago

Hey @mvsoom ,

Thanks for the heads up about this, will update this as soon as possible