Writing

Archive | Tags

Helpful PDB Commands

June 17, 2024  •  python | debugging
A list of helpful pdb commands for debugging Python programs

Torch - Get device across CPU / GPU / MPS

June 15, 2024  •  python | torch | mps | cuda | ml
Quick one-liner for running Torch on your Mac

Python script to remove image backgrounds for free

June 15, 2024  •  python | huggingface | transformers | images | background removal
Using the SOTA briaai/RMBG-1.4 model

AI Tool Review - Langflow

June 14, 2024  •  llms | ai | ml | langflow | rag | python | ai tool review
How to use the open source project Langflow to build RAG pipelines in a drag-and-drop no-code interface

AI Tool Review - Langfuse + LiteLLM

February 11, 2024  •  llms | ai | ml | langfuse | litellm | python | ai tool review
How to use the open source projects Langfuse and LiteLLM to automatically log your LLM calls across 100+ providers under a single interface

Transformer Math (Part 1) - Counting Model Parameters

How many parameters are in a HuggingFace model? A case study with GPT2

AI Tool Review - LM-Format-Enforcer for controlling LLM outputs

January 9, 2024  •  llms | ai | ml | hallucinations | lm-format-enforcer | python | ai tool review
How to use LM Format Enforcer to guarantee your LLM outputs valid JSON

How to properly take screenshots with Playwright and Selenium

January 2, 2024  •  websites | selenium | playwright | google chrome
A trick for capturing <select> menu popups that won't normally get included.

How to view (x,y) coordinates in Chrome Debugger

January 2, 2024  •  websites | google chrome | debugging
Get the (x,y) coordinates of arbitrary points on a webpage

AI Tool Review - ChromaDB as a local vector database for RAG

December 31, 2023  •  llms | ai | ml | chromed | rag | vector db | python | ai tool review
Some code snippets / tips for using ChromaDB

AI Tool Review - Outlines library for controlling LLM outputs

December 29, 2023  •  llms | ai | ml | hallucinations | outlines | python | ai tool review
A quick tutorial on how to use Outlines to guarantee your LLM outputs valid JSON

AI Tool Review - Microsoft LIDA for data exploration

September 27, 2023  •  llms | ai | ml | data exploration | lida | eda | microsoft | pandas | python | ai tool review
Trying out LIDA, an LLM-based data exploration tool from Microsoft Research

Diffusion Models from Scratch

July 1, 2023  •  diffusion models | machine learning | python | tutorial
Beginner's tutorial on how diffusion models work, with Python code + mathematical derivations and explanations

Python Argparse Cheatsheet

June 16, 2023  •  python | cli | argparse
Basic argparse template for Python 3

Productivity Tips for Jupyter Notebook

June 15, 2023  •  jupyter | python | vscode
How to be more productive using Jupyter notebook

Publish Python Package on PyPI with Poetry

April 27, 2023  •  python | poetry | packaging

How to package a Python library using Poetry and publish it on PyPI.

Screen utility - Enable scrolling by default

March 23, 2023  •  screen | linux | cli
Add `termcapinfo xterm* ti@:te@` to your `~/.screenrc` to enable normal scrolling

The default screen utility annoyingly requires you to hit Ctrl+A [ to scroll back through your terminal’s output buffer (by switching to “copy mode”). Otherwise, scrolling will cause you to cycle past your previous commands instead of scrolling back up in your terminal’s output.

How to Run Sbatch in Slurm

March 21, 2023  •  slurm | sbatch | compute | remote server
How to create and run an Sbatch job on Slurm

Flaregun - A Tiny PyTorch Helper Library

March 20, 2023  •  pytorch | ml
Figure out how much GPU memory is available on an Nvidia device in real-time, how many params are in a PyTorch model, etc.

Notes for Harvard's CS 287 NLP Course

March 14, 2023  •  AI | nlp | lecture notes

NOTE: These are all taken from Chris Tanner’s great NLP course CS 287 (taught at Harvard). None of this is my own work. This is just a collection of screenshots and notes from my own reading of the course’s lecture slides for my own reference and understanding. I would highly recommend reading the full lecture slides available here.