Skip to content

Instantly share code, notes, and snippets.

View muhark's full-sized avatar

Dr Musashi Hinck muhark

  • Intel Labs
View GitHub Profile
@muhark
muhark / hf_model_downloader.md
Last active June 20, 2024 05:37
Offline HuggingFace Models on HPC

Downloading HuggingFace Models

This gist shares a little workflow and script for a task that most people using university HPCs for NLP research will need to do: downloading and storing HuggingFace models for use on compute nodes.

What this workflow is for:

  • Context: you want to use HuggingFace models on Della (or other HPC clusters).
  • Problem 1: you cannot call AutoModel.from_pretrained('model/name') at run time because compute nodes are not connected to the internet.
  • Problem 2: running AutoModel.from_pretrained() on the head node is impractical because the model is too large to be loaded.
  • Problem 3: you do not want to save the model weights to the default ~/.cache/ because you only get 10GB of storage on /home
@muhark
muhark / azure_openai_usage.md
Last active April 10, 2024 14:44
Migrating to Azure Openai

This gist assumes that:

  • you are already using OpenAI services via the OpenAI API
  • you want to migrate to an Azure-based workflow
  • somebody else has already set up the Azure endpoint for you

Old Workflow (no Azure)

from openai import OpenAI