Skip to content

Huggingface Transformers/Tokenizers do not have required attributes for outlines.models.Transformers #961

Answered by lapp0
ahgraber asked this question in Q&A
Discussion options

You must be logged in to vote

You shouldn't be passing a TransformerTokenizer, it is created during initialization. Could you please try passing the AutoTokenizer instead?

class Transformers:
    """Represents a `transformers` model."""

    def __init__(
        self,
        model: "PreTrainedModel",
        tokenizer: "PreTrainedTokenizer",
    ):
        self.model = model
        self.tokenizer = TransformerTokenizer(tokenizer)

Also I'm noticing people using the internals rather than creating via model = outlines.models.transformers(<model_uri>). Could you help me understand why you're using the classes directly rather than the helper function / what your use case is?

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ahgraber
Comment options

Answer selected by ahgraber
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants