Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion gpt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import torch
import torch.nn as nn
from torch.nn import functional as F
import os
import subprocess

# hyperparameters
batch_size = 64 # how many independent sequences will we process in parallel?
Expand All @@ -18,7 +20,10 @@

torch.manual_seed(1337)

# wget https://raw.githubusercontent.com/karpathy/char-rnn/master/data/tinyshakespeare/input.txt
if not os.path.exists('input.txt'):
output = subprocess.check_output(["wget", "https://raw.githubusercontent.com/karpathy/char-rnn/master/data/tinyshakespeare/input.txt"])
print(output.decode())

with open('input.txt', 'r', encoding='utf-8') as f:
text = f.read()

Expand Down