Import a pre-trained AutoModel object for a specific task.
Source:R/transformers.R
hf_load_AutoModel_for_task.RdUse this function when you need to load an AutoModel for a specific task separate to a pipeline. The model's config should come ready-equipped for a specific task according to what you input as model_type.
Usage
hf_load_AutoModel_for_task(
model_type = "AutoModelForSequenceClassification",
model_id,
use_auth_token = NULL
)Arguments
- model_type
The AutoModel's type passed as a string e.g. c("AutoModelForQuestionAnswering", "AutoModelForTokenClassification", "AutoModelForSequenceClassification")
- model_id
The model's name or id on the Hugging Face hub
- use_auth_token
For private models, copy and paste your auth token in as a string.