Skip to content

Instantly share code, notes, and snippets.

View akaanirban's full-sized avatar
🏠
Working from home

Anirban Das akaanirban

🏠
Working from home
  • Capital One
  • San Mateo, CA
View GitHub Profile
@akaanirban
akaanirban / README.md
Created September 26, 2023 03:40
Download Models from Huggingface to a local directory and exclude `*.bin` files

Run the following code to download model to a. local directory from huggingface and exclude *.bin files:

import huggingface_hub

huggingface_hub.snapshot_download(repo_id="meta-llama/Llama-2-7b-chat-hf", local_dir="./meta-llama_Llama-2-7b-chat-hf", local_dir_use_symlinks=False, resume_download=True, ignore_patterns=["*.msgpack", "*.h5", "*.bin"])
print("done")
@akaanirban
akaanirban / README.md
Created November 8, 2023 18:39
Reverse Engineer docker image to build Dockerfile using docker history

The following is how you can sort of reverse engineer a docker image to get the Dockerfile using docker history. You can use a sophisticated tool like dive but that has its own problem.

Lets assume you have an image nvcr.io/nvidia/pytorch:23.10-py3

Run the following command to create a semi correct Dockerfile : docker history --no-trunc nvcr.io/nvidia/pytorch:23.10-py3 --format '{{ .CreatedBy }}' | tail -r > Dockerfile

The dockerfile:

/bin/sh -c #(nop)  ARG RELEASE
/bin/sh -c #(nop)  ARG LAUNCHPAD_BUILD_ARCH