Skip to content

Instantly share code, notes, and snippets.

@dylan-slack
dylan-slack / gpt3-estimate-costs.py
Created May 30, 2021 00:31
Compute the cost of running GPT3 on a set of prompts. Store all the costs incurred so far.
"""
Estimate GPT-3 costs!
Author: Dylan
"""
import math
class GPT3CostsCalculator:
def __init__(self,
gpt3_model_version,
@dylan-slack
dylan-slack / experiment_manager.py
Created July 18, 2019 01:28
A simple method to manage experiments
"""
A simple experiment manager. You can add experiments as functions with the @register decorator. Then, call the experiments you want to run
using the -r flag followed by the function names of the experiments or run all the experiments with the -a flag.
Experiment runs are stored in an .experiments/ folder created on the first time you run an experiment. Each run creates a folder inside
.experiments/ with the name of the function and the datetime it was run. Every experiment should accept a logging_path argument.
This is the path to the folder created for the specific experiment run. You can use this to store experiment specific files.
"""
import argparse
import datetime