-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature-extraction pipeline to return Tensor #10016
Comments
Hello! Indeed, this is a valid request. Would you like to open a PR and take a stab at it? |
@LysandreJik Hi, thanks for the fast reply ! Ok will do that :) |
Hi @LysandreJik is there any update on this issue? If @ierezell didn't have time, I might be able to give a shot at it in the next days |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
Hi! |
I think we'd still be open to that; WDYT @Narsil? |
Sure ! Would adding an argument |
I'm baffled as to why returning the features as a list is the default behavior in the first place... Isn't one common usage of feature extraction to provide an input to another model, which means it is preferred to keep it as a tensor? |
Well it depends, not necessarily. Another very common use case is to feed it to some feature database for querying later. But I kind of agree that it should be at least a Some If/When v5 is getting prepared there would be a lot of small but breaking changes in that regard. |
🚀 Feature request
Actually, to code of the feature-extraction pipeline
transformers.pipelines.feature-extraction.FeatureExtractionPipeline l.82
return asuper().__call__(*args, **kwargs).tolist()
Which gives a list[float] (or list[list[float]] if list[str] in input)
I guess it's to be framework agnostic, but we can specify
framework='pt'
in the pipeline config so I was expecting atorch.tensor
.Could we add some logic to return tensors ?
Motivation
Features will be used as input of other models, so keeping them as tensors (even better on GPU) would be profitable.
Thanks in advance for the reply,
Have a great day.
The text was updated successfully, but these errors were encountered: