LLM Cheat Sheets
Contains useful APIs to perform development tasks by LLM
Tokenizer
Useful to get token insights which is a backbone of LLM engineering
| No | Purpose | Hugging Face API | ChatGPT | OpenAI |
|---|---|---|---|---|
| 1 | Get tokenizer instance | tokenizer = AutoTekenizer.from_pretrained( |
||
| 2 | Get token details | tokens = tokenizer.encode(text) | ||
| 3 | convert tokens to text | tokenizer.decode(tokens) |
Prompt Engineering
Useful to execute prompts using LLM
| No | Purpose | Hugging Face API | ChatGPT | OpenAI |
|---|---|---|---|---|
| 1 | Get tokenizer instance | tokenizer = AutoTekenizer.from_pretrained( |
||
| 2 | Execute prompt as chat template | tokens = tokenizer.apply_chat_template( |
||
| 3 | convert tokens to text | tokenizer.decode(tokens) |