tunib-ai / parallelformers

Parallelformers: An Efficient Model Parallelization Toolkit for Deployment
https://tunib-ai.github.io/parallelformers
Apache License 2.0
776 stars 61 forks source link

How do I use this for zero shot classification tasks #12

Closed subhamkhemka closed 2 years ago

subhamkhemka commented 3 years ago

Hi

Thanks for this library.

I am using the huggingface zero shot classification pipeline with the typeform/distilbert-base-uncased-mnli model.

classifier = pipeline("zero-shot-classification", model="typeform/distilbert-base-uncased-mnli", device=0)

res = classifier(prod_name_lst, tag_values))

length of prod_name_lst is 500K and tag_values is 52.

I am currently using a loop based approach as the above code results in OOM error.

Please assist on how i can use parallelformers to scale for my dataset.

Thanks, Subham

hyunwoongko commented 2 years ago

Try parallelize(pipeline.model, ...)