Skip to content
This repository was archived by the owner on Jun 15, 2026. It is now read-only.
This repository was archived by the owner on Jun 15, 2026. It is now read-only.

OPT models currently unsupported as generator #7

Description

@Harsha-Nori

Using any OPT model from the HuggingFace Transformers library (ex: https://huggingface.co/facebook/opt-350m) as a generator currently raises an exception when attempting to generate suggestions:

Error:

File ".../python3.9/site-packages/transformers/models/opt/modeling_opt.py", line 235, in forward
    raise ValueError(
        ValueError: Attention mask should be of size (1, 1, 0, 52), but is torch.Size([1, 1, 1, 1]
)

Workaround: We're actively looking into this, and recommend using GPT Neo (https://huggingface.co/docs/transformers/model_doc/gpt_neo) as an alternative:

import adatest
import transformers

# gen_model = "facebook/opt-125m"  # Currently unsupported
gen_model = "EleutherAI/gpt-neo-125M"
opt_gen = transformers.pipeline('text-generation', model=gen_model)
generator = adatest.generators.Transformers(opt_gen.model, opt_gen.tokenizer)

adatest.serve(tests(model, generator, auto_save=True))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions