Unable to use pipeline

#1
by AlonCohen - opened

Hi, is anyone else experiencing the same behavior when using pipline?

from transformers import pipeline

pipe = pipeline("feature-extraction", model="dicta-il/dictabert-tiny-joint", trust_remote_code=True)
pipe("讘砖谞转 1948 讛砖诇讬诐 讗驻专讬诐 拽讬砖讜谉 讗转 诇讬诪讜讚讬讜 讘驻讬住讜诇 诪转讻转 讜讘转讜诇讚讜转 讛讗诪谞讜转 讜讛讞诇 诇驻专住诐 诪讗诪专讬诐 讛讜诪讜专讬住讟讬讬诐")

Error:

TypeError                                 Traceback (most recent call last)
<ipython-input-57-38fb8274e7c7> in <cell line: 5>()
      3 
      4 pipe = pipeline("feature-extraction", model="dicta-il/dictabert-tiny-joint", trust_remote_code=True)
----> 5 pipe("讘砖谞转 1948 讛砖诇讬诐 讗驻专讬诐 拽讬砖讜谉 讗转 诇讬诪讜讚讬讜 讘驻讬住讜诇 诪转讻转 讜讘转讜诇讚讜转 讛讗诪谞讜转 讜讛讞诇 诇驻专住诐 诪讗诪专讬诐 讛讜诪讜专讬住讟讬讬诐")

14 frames
/usr/local/lib/python3.10/dist-packages/torch/nn/functional.py in embedding(input, weight, padding_idx, max_norm, norm_type, scale_grad_by_freq, sparse)
   2231         # remove once script supports set_grad_enabled
   2232         _no_grad_embedding_renorm_(weight, input, max_norm, norm_type)
-> 2233     return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
   2234 
   2235 

TypeError: embedding(): argument 'indices' (position 2) must be Tensor, not NoneType
DICTA: The Israel Center for Text Analysis org

The model isn't designed for any of the generic pipelines since the output is tailored for the Hebrew language tasks.

Please try using the example on the model card.

Sign up or log in to comment