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

feat(runner): add transformers pipeline logic #367

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rickstaa
Copy link
Member

@rickstaa rickstaa commented Dec 13, 2024

This pull request adds the initial transformers pipeline which makes use of the pipeline abstraction of the transformers package to call any huggingface transformers pipeline.

Warning

Do not merge this version is not safe to run on the orchestrator network since it exposes a lot and doesn't clean disk space.

@rickstaa rickstaa marked this pull request as draft December 13, 2024 18:52
@rickstaa rickstaa force-pushed the add_transformers_pipeline branch 3 times, most recently from 4b953eb to aea33da Compare December 13, 2024 19:45
This commit adds the initial transformers pipeline which makes use of
the pipeline abstraction of the transformers package to call any
huggingface transformers pipeline.
@rickstaa rickstaa force-pushed the add_transformers_pipeline branch from aea33da to 3f8fd03 Compare December 13, 2024 20:59
if request.model_name:
pipeline_kwargs["model"] = request.model_name
try:
pipe = pipeline(device=torch_device, **pipeline_kwargs)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm haven't checked whether models are removed from the GPU afterward.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rickstaa I think either we can perform cache cleaning with empty_cache() or use pipeline in context manager: with pipeline(...)

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

Successfully merging this pull request may close these issues.

2 participants