![image](https://private-user-images.githubusercontent.com/1523305/293961619-b1d71975-f0a5-4127-8214-e36e2a58d3f6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0MDMxNTIsIm5iZiI6MTcyMTQwMjg1MiwicGF0aCI6Ii8xNTIzMzA1LzI5Mzk2MTYxOS1iMWQ3MTk3NS1mMGE1LTQxMjctODIxNC1lMzZlMmE1OGQzZjYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTlUMTUyNzMyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTk3MDQxYzRkMmY2Y2YyZjc4MGQxNjJlYjkyMDRjN2U1OGE2YzA3YzUyMDlhYzI0MDZkNTMxNjIwNjQwNDg4ZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.LkQkv3m6lp4udbDVU6jV75WDTdsVZeiFHX-TGe-cbSw)
![image](https://private-user-images.githubusercontent.com/1523305/293961619-b1d71975-f0a5-4127-8214-e36e2a58d3f6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0MDMxNTIsIm5iZiI6MTcyMTQwMjg1MiwicGF0aCI6Ii8xNTIzMzA1LzI5Mzk2MTYxOS1iMWQ3MTk3NS1mMGE1LTQxMjctODIxNC1lMzZlMmE1OGQzZjYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTlUMTUyNzMyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTk3MDQxYzRkMmY2Y2YyZjc4MGQxNjJlYjkyMDRjN2U1OGE2YzA3YzUyMDlhYzI0MDZkNTMxNjIwNjQwNDg4ZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.LkQkv3m6lp4udbDVU6jV75WDTdsVZeiFHX-TGe-cbSw)
#!/usr/bin/env bash | |
function p() { | |
jq -n \ | |
--arg content "$*" \ | |
'{ | |
"model": "pplx-7b-online", | |
"messages": [ | |
{ | |
"role": "system", | |
"content": "Be precise and concise." |
// nodejs script that adds a new version to the project. (git(local, and remote), package.json and a commit message) | |
// example: node setNewVersion.js 0.0.1 | |
const fs = require('fs'); | |
const path = require('path'); | |
const { exec } = require('child_process'); | |
let v = process.argv[2]; | |
if (v.charAt(0) === 'v') { | |
v = v.substring(1); |
# Example usage: | |
# python make_crop_labels.py --input_path data/images --output_path --data/cropped_images --csv_path data/crops.csv | |
# Controls: | |
# scroll to change crop size, mouse to aim the crop, left click to crop image and move to next, x to skip to the next image. | |
# The script is pretty messy since I quickly hacked it together with little regard for quality, but it works. | |
import pygame | |
import argparse |
I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.
I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:
# Run with: python data_filter.py --input_path <input path> --output_path <output path> | |
# Controls: z to copy image into output directory, x to skip to next image. | |
import pygame | |
import argparse | |
import shutil | |
import os | |
import argparse | |
def load_image(path): |
# 2023-11-27 MIT LICENSE | |
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com. | |
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town. | |
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same! | |
Send me your ChatGPT text adventure game on X, I'd love to try it! |
I just read this trick for text compression, in order to save tokens in subbsequent interactions during a long conversation, or in a subsequent long text to summarize.
It's useful to give a mapping between common words (or phrases) in a given long text that one intends to pass later. Then pass that long text to gpt-4 but encoded with such mapping. The idea is that the encoded version contains less tokens than the original text. There are several algorithms to identify frequent words or phrases inside a given text, such as NER, TF-IDF, part-of-speech (POS) tagging, etc.
export function mergeRefs(refs) { | |
return (value) => { | |
refs.forEach((ref) => { | |
if (typeof ref === "function") { | |
ref(value); | |
} else if (ref != null) { | |
ref.current = value; | |
} | |
}); | |
}; |