Category Uncategorized

How to run an LLM locally with Ollama

Today we will try running an LLM locally on a Macbook Pro with Apple Silicon. To do this we will use ollama, since it is one of the easiest ways. First, download the right installer for your OS from ollamma.com.…

Playing Shadowrun with ChatGPT

I read an article by a guy who used ChatGPT4 as the dungeon master for a solo compaign for Dungeons & Dragons. Just him and ChatGPT. The chatbot fully played the role of a human dungeon master! It sounded really…

How to Draw an Owl

Taken from lecture 1 of Statistical Rethinking course (around the 44 minute mark). The course material is also on Github. How to draw an "owl" version 1: Create generative simulation (GS) Write an estimator Validate estimator using simulated data Analyze…

How to call an API from PySpark (in workers)

Tested in Databricks import pyspark.sql.functions as F import requests # create dataframe pokenumbers = [(i,) for i in range(100)] cols = ["pokenum"] df_pokenums = spark.createDataFrame(data=pokenumbers, schema=cols) # call API def get_name(rows): # take the first item in list (API doesn't…

Getting back into operations research

For the last five years, I have been fascinated with machine learning techniques, but that fascination is slowly running out. I increasingly consider ML a tool in my tool box among others, not a panacea to all problems. In particular,…

Good Book, Bad Program

Programming is like writing a book. Both programs and books are written in a language, e.g. Datalog or Tagalog, but the similarity goes deeper than that. Imagine that you must write a book with the subject "a man walks his…