transformers icon indicating copy to clipboard operation
transformers copied to clipboard

Unknown task fill-mask

Open DesiKeki opened this issue 6 years ago • 3 comments

🐛 Bug

Information

I am trying to create a "Pipeline" for fill-mask task

Language I am using the model on is English

The problem arises when using: My own modified scripts: (give details below)

import transformers
transformers.__version__

'2.3.0'

from transformers import pipeline
nlp_fill = pipeline('fill-mask')
nlp_fill('Hugging Face is a French company based in <mask>')

KeyError Traceback (most recent call last) in ----> 1 nlp_fill = pipeline('fill-mask') 2 nlp_fill('Hugging Face is a French company based in ')

~\Anaconda3\lib\site-packages\transformers\pipelines.py in pipeline(task, model, config, tokenizer, modelcard, **kwargs) 848 # Retrieve the task 849 if task not in SUPPORTED_TASKS: --> 850 raise KeyError("Unknown task {}, available tasks are {}".format(task, list(SUPPORTED_TASKS.keys()))) 851 852 framework = get_framework(model) KeyError: "Unknown task fill-mask, available tasks are ['feature-extraction', 'sentiment-analysis', 'ner', 'question-answering']"

The tasks I am working on is: My own task or dataset. Trying using Pipeline.

To reproduce

Steps to reproduce the behavior:

from transformers import pipeline nlp_fill = pipeline('fill-mask') nlp_fill('Hugging Face is a French company based in ')

Expected behavior

Should have got a filled output with a score.

Environment info

'transformers-cli' is not recognized as an internal or external command, operable program or batch file.

  • transformers version: 2.3.0
  • Platform: Windows Jupyter notebook
  • Python version: 3.7.4

DesiKeki avatar May 15 '20 09:05 DesiKeki

Can you upgrade your version of transformers?

julien-c avatar May 15 '20 13:05 julien-c

Same issue I am not able to run the command transformer-cli env even after installing from source @julien-c .

transformers-cli is not recognized as an internal or external command operable program or batch file

Just wondering if this is due to the fact of using conda as in latest versions it is not preferring to modify the PYTHONPATH. hence the non visibility of the command?

Sriharsha-hatwar avatar May 16 '20 04:05 Sriharsha-hatwar

Upgrading the transformers version to 2.9.1 works!

DesiKeki avatar May 16 '20 06:05 DesiKeki