Skip to content

Private (gen) model from HF fails running in promptnode #6501

@ArzelaAscoIi

Description

@ArzelaAscoIi

Describe the bug
(generative) private models on huggingface can't be run, since they append use_auth_token to the model kwargs which is not expected.
That means:

  • using private models from HF within the Promptnode does not work
  • if you configure an auth token and you have a public model, your will be able to initialize, but not run the pipeline (quite an edge case)

Error message

ValueError: The following `model_kwargs` are not used by the model: ['use_auth_token'] (note: typos in the generate arguments will also show up in this list)

Expected behavior
Send token to HF for download but not inject args as model_kwargs

Additional context
Add any other context about the problem here, like document types / preprocessing steps / settings of reader etc.

To Reproduce

from haystack.nodes import PromptNode, PromptTemplate
from haystack import Document


# Works
pn_works = PromptNode(
    default_prompt_template=PromptTemplate(prompt="deepset/summarization"),
    model_name_or_path="google/flan-t5-base",
)
# retunrs successful
pn_works.run("That works!",documents=[Document(content="asdf")])


# Fails
pn_fails = PromptNode(
    default_prompt_template=PromptTemplate(prompt="deepset/summarization"),
    model_name_or_path="google/flan-t5-base",
    use_auth_token="<any-hf-token>",
)
# retunrs successful
pn_fails.run("Oh no!",documents=[Document(content="asdf")])

FAQ Check

System:

  • N/A

Metadata

Metadata

Assignees

Labels

P1High priority, add to the next sprint

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions