transformers
1baeed5b - Fix return_dict_in_generate bug in InstructBlip generate function (#25246)

Commit
2 years ago
Fix return_dict_in_generate bug in InstructBlip generate function (#25246) Fix bug in InstructBlip generate function Previously, the postprocessing conducted on generated sequences in InstructBlip's generate function assumed these sequences were tensors (i.e. that `return_dict_in_generate == False`). This commit checks whether the result of the call to the wrapped language model `generate()` is a tensor, and if not attempts to postprocess the sequence attribute of the returned results object.
Author
Parents
Loading