jina-ai / serve

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

TransformerTorchEncoder Install Cannot Find torch Version #6103

Closed dkintgen closed 9 months ago

dkintgen commented 1 year ago

Describe the bug I am attempting to leverage a TransformerTorchEncoder in my flow to index documents. When I run flow.index(docs, show_progress=True) with this encoder, it fails when attempting to install with the message:

CalledProcessError: Command '['/home/ec2-user/anaconda3/envs/python3/bin/python', '-m', 'pip', 'install', '--compile', '--default-timeout=1000', 'torch==1.9.0+cpu', 'transformers>=4.12.0', '-f', 'https://download.pytorch.org/whl/torch_stable.html']' returned non-zero exit status 1.

This is the detailed info I can find in the error:

Looking in links: https://download.pytorch.org/whl/torch_stable.html ERROR: Could not find a version that satisfies the requirement torch==1.9.0+cpu (from versions: 1.11.0, 1.11.0+cpu, 1.11.0+cu102, 1.11.0+cu113, 1.11.0+cu115, 1.11.0+rocm4.3.1, 1.11.0+rocm4.5.2, 1.12.0, 1.12.0+cpu, 1.12.0+cu102, 1.12.0+cu113, 1.12.0+cu116, 1.12.0+rocm5.0, 1.12.0+rocm5.1.1, 1.12.1, 1.12.1+cpu, 1.12.1+cu102, 1.12.1+cu113, 1.12.1+cu116, 1.12.1+rocm5.0, 1.12.1+rocm5.1.1, 1.13.0, 1.13.0+cpu, 1.13.0+cu116, 1.13.0+cu117, 1.13.0+cu117.with.pypi.cudnn, 1.13.0+rocm5.1.1, 1.13.0+rocm5.2, 1.13.1, 1.13.1+cpu, 1.13.1+cu116, 1.13.1+cu117, 1.13.1+cu117.with.pypi.cudnn, 1.13.1+rocm5.1.1, 1.13.1+rocm5.2, 2.0.0, 2.0.0+cpu, 2.0.0+cpu.cxx11.abi, 2.0.0+cu117, 2.0.0+cu117.with.pypi.cudnn, 2.0.0+cu118, 2.0.0+rocm5.3, 2.0.0+rocm5.4.2, 2.0.1, 2.0.1+cpu, 2.0.1+cpu.cxx11.abi, 2.0.1+cu117, 2.0.1+cu117.with.pypi.cudnn, 2.0.1+cu118, 2.0.1+rocm5.3, 2.0.1+rocm5.4.2, 2.1.0, 2.1.0+cpu, 2.1.0+cpu.cxx11.abi, 2.1.0+cu118, 2.1.0+cu121, 2.1.0+cu121.with.pypi.cudnn, 2.1.0+rocm5.5, 2.1.0+rocm5.6) ERROR: No matching distribution found for torch==1.9.0+cpu

Is there any way to update this version or ignore the version so that this can install correctly?

Describe how you solve it


Environment

Screenshots

JoanFM commented 1 year ago

Can you please share the Flow or Deplpyment YAML u are trying to use?

dkintgen commented 1 year ago

I am trying to work through the following example notebook:

https://colab.research.google.com/github/jina-ai/workshops/blob/main/pdf_search/pdf_search.ipynb#scrollTo=J5F_waOoQS-7

When I get to the "Encode the text" step and add the Encoder, then attempt to call

with flow:
  docs = flow.index(docs, show_progress=True)

is where the error occurs.

Hopefully this helps. I am new to Jina so still learning my way around.

JoanFM commented 1 year ago

Apparently, the dependencies seem only to be available for Python 3.7 and not for Python 3.10. We are not mantaining these Hub Executors anymore, but u can try to change the requirements to newer pytorch versions

dkintgen commented 1 year ago

Should I be looking at alternate functionality to achieve what is done in this Notebook? Sounds like Hub Executors may not be the way to go. As mentioned, I am new to Jina so just trying to get my bearings with the product.

JoanFM commented 1 year ago

I think the best way to get ur hands in the project is to follow the examples in the README to understand the main concepts, and try to build your own services using it

jina-bot commented 9 months ago

@jina-ai/product This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days