Go to the source code of this file.
Namespaces | |
namespace | gpt |
Variables | |
int | gpt.batch_size = 64 |
int | gpt.block_size = 256 |
int | gpt.max_iters = 5000 |
int | gpt.eval_interval = 500 |
int | gpt.learning_rate = 3e-4 |
str | gpt.device = "mps" |
int | gpt.eval_iters = 200 |
int | gpt.n_embd = 384 |
int | gpt.n_head = 6 |
int | gpt.n_layer = 6 |
float | gpt.dropout = 0.2 |
gpt.input_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "input.txt")) | |
gpt.encoding | |
gpt.text = f.read() | |
gpt.chars = sorted(list(set(text))) | |
gpt.vocab_size = len(chars) | |
dict | gpt.stoi = {ch: i for i, ch in enumerate(chars)} |
dict | gpt.itos = {i: ch for i, ch in enumerate(chars)} |
gpt.encode = lambda s: [stoi[c] for c in s] | |
str | gpt.decode = lambda l: "".join([itos[i] for i in l]) |