File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 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,
127127 if self .task == 'punc' :
128128 # punc list
129129 self ._punc_list = []
130- with open (self .vocab_file , 'r' ) as f :
130+ with open (self .vocab_file , 'r' , encoding = 'utf-8' ) as f :
131131 for line in f :
132132 self ._punc_list .append (line .strip ())
133133
@@ -178,12 +178,12 @@ def _init_from_path_new(self,
178178 if self .task == 'punc' :
179179 # punc list
180180 self ._punc_list = []
181- with open (self .vocab_file , 'r' ) as f :
181+ with open (self .vocab_file , 'r' , encoding = 'utf-8' ) as f :
182182 for line in f :
183183 self ._punc_list .append (line .strip ())
184184
185185 # model
186- with open (self .cfg_path ) as f :
186+ with open (self .cfg_path , 'r' , encoding = 'utf-8' ) as f :
187187 config = CfgNode (yaml .safe_load (f ))
188188 self .model = ErnieLinear (** config ["model" ])
189189
You can’t perform that action at this time.
0 commit comments