File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ def _init_from_path(self,
127
127
if self .task == 'punc' :
128
128
# punc list
129
129
self ._punc_list = []
130
- with open (self .vocab_file , 'r' ) as f :
130
+ with open (self .vocab_file , 'r' , encoding = 'utf-8' ) as f :
131
131
for line in f :
132
132
self ._punc_list .append (line .strip ())
133
133
@@ -178,12 +178,12 @@ def _init_from_path_new(self,
178
178
if self .task == 'punc' :
179
179
# punc list
180
180
self ._punc_list = []
181
- with open (self .vocab_file , 'r' ) as f :
181
+ with open (self .vocab_file , 'r' , encoding = 'utf-8' ) as f :
182
182
for line in f :
183
183
self ._punc_list .append (line .strip ())
184
184
185
185
# model
186
- with open (self .cfg_path ) as f :
186
+ with open (self .cfg_path , 'r' , encoding = 'utf-8' ) as f :
187
187
config = CfgNode (yaml .safe_load (f ))
188
188
self .model = ErnieLinear (** config ["model" ])
189
189
You can’t perform that action at this time.
0 commit comments