Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pipelineSnippet for repos with custom pipelines #595

Open
not-lain opened this issue Mar 29, 2024 · 2 comments
Open

fix pipelineSnippet for repos with custom pipelines #595

not-lain opened this issue Mar 29, 2024 · 2 comments
Assignees

Comments

@not-lain
Copy link

given a repo with a custom pipeline and not a custom model

the pipelineSnippet is wrongly annotated

what is present

image

expected snippet

# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("pair-classification", model="sgugger/test-dynamic-pipeline",trust_remote_code=True)

the pair-classification task is present in the config.json

what needs to be fixed

  • the trust_remote_code = True is essential (MUST FIX THIS ONE)
  • the task does not matter much (the pipeline is already customly built) i'll leave the task as an optional feature to you to decide either to fix it or not (recommend we do to anticipate any upcoming features such as multiple pipelines in the same repo) (OPTIONAL)
@not-lain
Copy link
Author

extra info, the trust_remote_code = True MUST be there for the following conditions :

  • either there is a custom model ( meaning auto_map is present in the config.json )
  • or either custom_pipelines is present in the config.json

I also would like to request a feature which is to add a tag talled custom_pipelines for repos with a custom pipeline (LOW PRIORITY)

@osanseviero osanseviero self-assigned this Mar 29, 2024
@not-lain
Copy link
Author

@osanseviero

recommend we do to anticipate any upcoming features such as multiple pipelines in the same repo

the pipelines currently only takes 1 and only 1 custom pipeline at a time, and i don't think they will allow for multiple pipelines in 1 repo any time soon
resource : https://github.com/huggingface/transformers/blob/main/src/transformers/pipelines/base.py#L940

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants