question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pipeline "zero-shot-classification" is not supported

See original GitHub issue

System Info

google colab:
   optimum==1.3.0, python==3.7.13

two ubuntu 20.04 systems:
   transformers==4.20.1
   optimum==1.2.3
   python==3.9.12

docker:
   transformers==4.20.1
   optimum==1.2.3
   python==3.9.12

Who can help?

@philschmid

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

I am trying to load “zero-shot-classification” pipeline. I am getting the following error:

from optimum.pipelines import pipeline

classifier = pipeline(task="zero-shot-classification", accelerator="ort")
ValueError                                Traceback (most recent call last)
[<ipython-input-3-0f041b354f55>](https://localhost:8080/#) in <module>()
      1 from optimum.pipelines import pipeline
      2 
----> 3 classifier = pipeline(task="zero-shot-classification", accelerator="ort")

[/usr/local/lib/python3.7/dist-packages/optimum/pipelines.py](https://localhost:8080/#) in pipeline(task, model, tokenizer, feature_extractor, use_fast, use_auth_token, accelerator, **kwargs)
    106 
    107     if targeted_task not in list(SUPPORTED_TASKS.keys()):
--> 108         raise ValueError(f"Task {targeted_task} is not supported. Supported tasks are { list(SUPPORTED_TASKS.keys())}")
    109 
    110     if accelerator != "ort":

ValueError: Task zero-shot-classification is not supported. Supported tasks are []

Expected behavior

Pipeline should download the default model.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
regissscommented, Jul 18, 2022

@Sudo-Swapnil #301 has been merged, so you should be able to make it work if you install Optimum from the current main branch: python -m pip install git+https://github.com/huggingface/optimum.git.

1reaction
regissscommented, Jul 18, 2022

@Sudo-Swapnil Optimum comes with a lot of subpackages (onnxruntime, intel, graphcore, habana) and we prefer not installing by default a library that won’t be used by other subpackages and might create conflicts. So I think we should keep onnxruntime out of the base install.

However, the documentation may not be clear regarding the different possible setup configurations. Do not hesitate to propose a PR to improve it.

Closing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

New pipeline for zero-shot text classification - Transformers
Transformers now includes a new pipeline for zero-shot text classification. and likewise for each candidate label. It's therefore important to ...
Read more >
Onnx support for Zero Shot Classification Pipeline #13837
I am using the Zero Shot Classification Pipeline for my use cases which runs for millions ... Onnx currently supports following pipelines- SU....
Read more >
Zero-shot Text Classification with Hugging Face on Gradient
In this tutorial, we look at and implement the pipeline for running zero-shot text classification with Hugging Face on a Gradient Notebook.
Read more >
Unknown task text-classification, available tasks are ['feature ...
It looks like the example that you referenced from their docs is out of date. The text-classification pipeline has been renamed to ...
Read more >
Zero-Shot Text Classification - statworx
Though pre-trained language models like BERT can reduce the amount of data needed, it does not make it obsolete altogether. Therefore, for real- ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found