spacy-transformers with GPT-2 #9491
-
I apologize if this question is obvious and/or naive, but I am really struggling to identify (or even work through, for that matter) a basic example of getting GPT-2 loaded into spacy. I am aware that we can use the default Roberta model with The resources I am aware of:
Worth noting, the first link above refers to an article from 2019 and itemizes LMs that I can't identify in the documentation. Speaking of documentation, I have seen examples of changing the configuration for the transfomers to specify a model in v3. However that is paired with adding the pipe to the existing In summary, what is the best way to load other other transformer models other than Roberta in v3? Cheers. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You can use other models by passing the name (from HuggingFace hub) to the Transformer model, as described in the docs here. In code that looks something like:
You can also change this in the config. |
Beta Was this translation helpful? Give feedback.
-
Hi, there are some known bugs with For now, the easiest option is to try out a prerelease of the next version with You will probably need to set the padding token manually in the config: [components.transformer.model.tokenizer_config]
use_fast = true
pad_token = "<|endoftext|>" |
Beta Was this translation helpful? Give feedback.
You can use other models by passing the name (from HuggingFace hub) to the Transformer model, as described in the docs here. In code that looks something like:
You can also change this in the config.