We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b7e194a commit f35dc82Copy full SHA for f35dc82
1 file changed
data/shakespeare/prepare.py
@@ -7,10 +7,10 @@
7
input_file_path = os.path.join(os.path.dirname(__file__), 'input.txt')
8
if not os.path.exists(input_file_path):
9
data_url = 'https://raw.githubusercontent.com/karpathy/char-rnn/master/data/tinyshakespeare/input.txt'
10
- with open(input_file_path, 'w') as f:
+ with open(input_file_path, 'w', encoding='utf-8') as f:
11
f.write(requests.get(data_url).text)
12
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