-
Notifications
You must be signed in to change notification settings - Fork 30.9k
Closed
Labels
Description
System Info
As originally pointed out by @radoslav-dimitrov-indeavr (see this comment), PR #37307 adds a torch invocation to pipelines, which will cause pure tensorflow applications to break.
transformers/src/transformers/pipelines/base.py:
if torch.distributed.is_initialized():
Who can help?
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examples
folder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
Repro: create an environment with transformers and tensorflow but without pytorch.
classifier = pipeline("sentiment-analysis"
Output:
NameError: name 'torch' is not defined
Expected behavior
Given that pipelines are supported for pure Tensorflow applications, said applications should not require a pytorch installation.