[ot][spam][crazy] crazylogs: STaR

Undiscussed Horrific Abuse, One Victim of Many gmkarl at gmail.com
Tue Jul 5 16:56:25 PDT 2022


i was reading https://docs.adapterhub.ml/training.html . its link to
run_glue is broken.

i was copying from
https://github.com/adapter-hub/adapter-transformers/blob/master/examples/pytorch/text-classification/run_glue.py#L364
which is the right link now

i had gotten this far and it was lots of fun:

import transformers

def go(model_name, task_name=None, labels=None, config_name = None,
tokenizer_name=None, revision=None):
    config = transformers.AutoConfig.from_pretrained(config_name if
config_name else model_name, num_labels=len(labels) if labels else
None, revision=revision, finetuning_task=task_name)
    tokenizer =
transformers.AutoTokenizer.from_pretrained(tokenizer_name if
tokenizer_name else model_name, revision=revision, use_fast=True)
    model = transformers.AutoAdapterModel.from_pretrained(model_name,
config=config, revision=revision)

    if labels:
        model.add_classification_head(
            task_name or '',
            num_labels=len(labels)
            id2label={i: v for i, v in enumerate(labels)} if
num_labels > 0 else None,
        )


More information about the cypherpunks mailing list