Offline Set-up

To use Huggingface models offline you will need to download the models on a machine connected to the internet and then copy them across. The easiest way to do this is to get this service running on a machine connected to the internet and let it download all of the models for you.

You do not need to the rest of Aiimi Insight Engine running to do this, just the Rest Enrichment Service.

More Information about how the Huggingface cache works can be found in their install doc. (See the Caceh set up section) https://huggingface.co/docs/transformers/installation

Rest Enrichment Service set up

  1. Get the Rest Enrichment Service set up on an internet connected machine.

  2. Enable the transformers based steps in your configuration files.

  3. Run the service with run.bat

    • These are large files and may take a few minutes.

    • You should see log messages that indicate its downloading models from the internet –

Find the models

  1. Find your models.

    • On a windows, by default, they can be found in: Local Disk > Users > username > .cache > huggingface > transformers

  1. Zip them up and move them to the same place on the target server.

    • Make sure you place them into the right users .cache folder. You are probably running the service as a different user on the target system.

  2. On the target system set an environment variable: TRANSFORMERS_OFFLINE=1

  3. Run the service.

Last updated