Hugging Face Sheets add-on

Hugging Face in your spreadsheet?

Because spreadsheets can be incredibly useful for journalists, this project connects Hugging Face Inference API with Google Sheets. Handy for prompting, extraction, classification, translation, etc.

Steps

  1. Create a script in Google Sheets (Extensions > Apps Script).

  2. Replace the existing code with this script and save it.

  3. Back in the Sheet, you should see a new tab called "Hugging Sheets".

  4. Click on it and add your API key.

  5. VoilĂ !

Note: To generate your API key, click on the Access Token tab in your Hugging Face settings.

Tested with Llama 8B and 70B, and Mistral, e.g.:

Update: Thanks to @louisbrulenaudet, you can now customize your prompt and select the model of your choice directly in the sheet.

The formula is:

  • =HF(cell or direct input, cell with the name of the model, cell with the prompt)
  • This blog post gives a good overview of the supported models.