This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import openai | |
import scipy.special | |
import tiktoken | |
def get_top_chat_logprobs( | |
model: str, | |
messages: list[dict[str, str]], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch.utils.data | |
import torchvision | |
from ffcv.fields import IntField, RGBImageField | |
from ffcv.writer import DatasetWriter | |
ds = torch.utils.data.Subset( | |
dataset=torchvision.datasets.CIFAR10( | |
"/var/tmp", train=False, download=True | |
), | |
indices=range(64), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remap prefix to Control + a | |
set -g prefix C-a | |
# bind 'C-a C-a' to type 'C-a' | |
bind C-a send-prefix | |
unbind C-b | |
set-window-option -g mode-keys vi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
# Initialization code that may require console input (password prompts, [y/n] | |
# confirmations, etc.) must go above this block; everything else may go below. | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
fi | |
# Begin history configuration | |
HISTFILE=~/.zsh_history | |
HISTSIZE=1000000000 # max events to load into memory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set softtabstop=4 shiftwidth=4 expandtab | |
set autoindent | |
set number | |
set colorcolumn=81 | |
autocmd BufWritePre * %s/\s\+$//e | |
set backspace=indent,eol,start | |
filetype indent plugin on | |
syntax enable | |
set background=dark |