I am working on a task in which I should modify the encoding results.
what I would like to do is generally like this:
input_ids = tokenizer(“i am trying hard!”, return_tensors=‘pt’).input_ids
last_hidden_state=model.encoder(input_ids=input_ids).last_hidden_state
modified_last_hidden_state = modify(last_hidden_state)
outputs = model.decoder(modified_last_hidden_state)
output_sequence = tokenizer.decode(outputs)
I think this model.decoder() actually doesn’t work as I want.