Packing LLM Data Files into an Uncompressed ZIP

Packing LLM Data Files into an Uncompressed ZIP
Photo by David Bruno Silva / Unsplash

When building LLM services, we often need to move an LLM that has already been downloaded once to a different server.
(When you want to use the same LLM model on servers with an identical configuration, this is faster than downloading it again from Hugging Face, for example.)

When a folder is awkward to move as-is, we compress it into a ZIP archive.

With no compression, even multi-gigabyte data can be archived quite quickly.

Installing ZIP

sudo apt install zip -y

Creating an uncompressed ZIP

Specify the target LLM directory and run the following command.

For example, if the LLM directory is /mnt/d/RakutenAI-7B-chat-awq, then:

cd /mnt/c/RakutenAI-7B-chat-awq
zip -r -0 /mnt/c/RakutenAI-7B-chat-awq.zip .

Command details

  • cd /mnt/c/RakutenAI-7B-chat-awq: Change into the folder to be archived.
  • zip: Run the zip command.
  • -r: Recursively include the files and subfolders inside the folder.
  • -0: Do not compress (store only).
  • /mnt/c/RakutenAI-7B-chat-awq.zip: Path of the output ZIP file.
  • .: Archive the contents of the current directory.

The reason for the cd is so that the directory structure is not reproduced inside the ZIP.

How to extract the ZIP

unzip /mnt/c/RakutenAI-7B-chat-awq.zip -d /mnt/c

Read more