ValueError
#1
by
JanVythikowski
- opened
docs_texts = ['My dummy text','My text']
docs_inps = tokenizer(
docs_texts, truncation=True, padding=True, return_tensors="pt"
)
model = AutoModel.from_pretrained('sentence-transformers/gtr-t5-base')
model(**docs_inps)
I get 'ValueError: You have to specify either decoder_input_ids or decoder_inputs_embeds'. Nevertheless, the model only uses the encoder.
It seems that you also include the T5 decoder in the architecture.
Hello!
The recommended usage for this model is via sentence_transformer
, e.g.:
from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]
model = SentenceTransformer('sentence-transformers/gtr-t5-xl')
embeddings = model.encode(sentences)
print(embeddings)
tomaarsen
changed discussion status to
closed