Merge pull request #82 from danielgross/master

Missed two spots while relative pathing
This commit is contained in:
Andrej authored and GitHub committed 2023-01-22 13:47:32 -08:00
commit 6c40a08b41
2 files changed
+8 -6

No files matched your search

+4 -3
View File
@@ -4,12 +4,13 @@ import tiktoken
import numpy as np
# download the tiny shakespeare dataset
if not os.path.exists('input.txt'):
input_file_path = os.path.join(os.path.dirname(__file__), 'input.txt')
if not os.path.exists(input_file_path):
data_url = 'https://raw.githubusercontent.com/karpathy/char-rnn/master/data/tinyshakespeare/input.txt'
with open('input.txt', 'w') as f:
with open(input_file_path, 'w') as f:
f.write(requests.get(data_url).text)
with open('input.txt', 'r') as f:
with open(input_file_path, 'r') as f:
data = f.read()
n = len(data)
train_data = data[:int(n*0.9)]
+4 -3
View File
@@ -10,12 +10,13 @@ import requests
import numpy as np
# download the tiny shakespeare dataset
if not os.path.exists('input.txt'):
input_file_path = os.path.join(os.path.dirname(__file__), 'input.txt')
if not os.path.exists(input_file_path):
data_url = 'https://raw.githubusercontent.com/karpathy/char-rnn/master/data/tinyshakespeare/input.txt'
with open('input.txt', 'w') as f:
with open(input_file_path, 'w') as f:
f.write(requests.get(data_url).text)
with open('input.txt', 'r') as f:
with open(input_file_path, 'r') as f:
data = f.read()
print(f"length of dataset in characters: {len(data):,}")