| hf_load_AutoModel_for_task | R Documentation |
Use 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.
hf_load_AutoModel_for_task(
model_type = "AutoModelForSequenceClassification",
model_id,
use_auth_token = NULL
)
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. |
an AutoModel object for a specific task
https://huggingface.co/transformers/v3.0.2/model_doc/auto.html
## Not run:
model <- hf_load_AutoModel_for_task(
"AutoModelForSequenceClassification",
"distilbert-base-uncased-finetuned-sst-2-english"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.