[Pipeline] avoid importing tensorflow if not used#17684
[Pipeline] avoid importing tensorflow if not used#17684NouamaneTazi wants to merge 2 commits intohuggingface:mainfrom
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
sgugger
left a comment
There was a problem hiding this comment.
Looks generally ok to me, but would like to see what @Narsil thinks since pipelines are his domain :-)
I can confirm that creating a pipeline(xxx) now imports TensorFlow even if the model is in PyTorch at the end. I don't think it was the case before (when I was writing the course so a while ago 😅), but maybe I misremember.
|
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. |
|
Was this issue resolved in another PR already? @sgugger |
|
The fact that TensorFlow takes all GPU memory has been fixed in #18044 |
What does this PR do?
Avoids loading unnecessary modules by
pipelines.base.infer_framework_load_model()which could create some unexpected behaviour like tensorflow allocating all GPU memory.@sgugger @LysandreJik
Before:
After: