We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f68ac22 + f35dc82 commit a022d02Copy full SHA for a022d02
2 files changed
.gitignore
@@ -8,3 +8,5 @@ __pycache__/
8
*.pt
9
*.pyc
10
input.txt
11
+env/
12
+venv/
data/shakespeare/prepare.py
@@ -7,10 +7,10 @@
7
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_file_path, 'w') as f:
+ with open(input_file_path, 'w', encoding='utf-8') as f:
f.write(requests.get(data_url).text)
13
-with open(input_file_path, 'r') as f:
+with open(input_file_path, 'r', encoding='utf-8') as f:
14
data = f.read()
15
n = len(data)
16
train_data = data[:int(n*0.9)]
0 commit comments