How to load a pipeline saved with pipeline.save_pretrained?

Hi,

I have a system saving an HF pipeline with the following code:

from transformers import pipeline
text_generator = pipeline('...')
text_generator.save_pretrained('modeldir')

How can I re-instantiate that model from a different system

What code snippet can do that? I’m looking for something like p = pipeline.from_pretrained('...') but couldn’t find such a thing in the doc

I think pipeline(task, 'modeldir') should work to reload it.

1 Like

looks good thanks!

1 Like

Hi,
Thank you for your comment
this give me this error
HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/model2/resolve/main/config.json