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.

Unable to use fill-mask pipeline on gpt-neo model

See original GitHub issue

Environment info

  • transformers version: 4.5.0
  • Platform: googleColab
  • Python version:3.7

Models: GPT neo

Code :

#Import Hugging Face's Transformers
from transformers import pipeline
generator = pipeline('fill-mask', model='EleutherAI/gpt-neo-1.3B')

Error: Screenshot 2021-05-19 at 10 55 30 AM

Can someone help me know what could the reason be for not able to use the fill-mask on gpt-neo model?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
NielsRoggecommented, May 19, 2021

Isn’t the text generation specific to generating new text with a given prompt? => well, normally it is meant to generate new text given a prompt indeed. But as models like GPT-3 and GPT-neo are so powerful and are trained on a lot of data, they are capable of performing what the authors of GPT-3 call “in-context learning”: this means that the model knows what to do just based on a given prompt. See the GPT-3 paper for more info.

I’ve just tried it with GPT-3 and it works. However, GPT-neo doesn’t seem as powerful. This is logical since GPT-3 has 175 billion parameters, whereas GPT-neo only has 1.3 billion (there’s also a 2.7 billion variant available).

Maybe you can try by giving more examples in the prompt. Sometimes it seems to work:

image

0reactions
github-actions[bot]commented, Jun 20, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when trying to use GPTNeo model · Issue #11543 - GitHub
I'll post another snippet. from transformers import GPT2Tokenizer, GPTNeoForCausalLM, pipeline import tensorflowjs tokenizer = GPT2Tokenizer.
Read more >
Pipelines - Hugging Face
This mask filling pipeline can currently be loaded from pipeline() using the following task identifier: "fill-mask" . The models that this pipeline can...
Read more >
How to use GPT-3 for fill-mask tasks? - python - Stack Overflow
First of all, I don't think you can access properties like token or scores in GPT-3, all you have is the generated text....
Read more >
AI Hello World | The FreeBSD Forums
Been playing last weekend with GPT-Neo-2.7B (2.7 Billion parameters), a pre-trained model from Eleuther.AI (open source, academic foundation ...
Read more >
Transformers: State-of-the-Art Natural Language Processing
v4.11.0: GPT-J, Speech2Text2, FNet, Pipeline GPU utilization, dynamic model code loading GPT-J Three new models are released as part of the ...
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