File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ pub async fn run(
108108 // Load config
109109 let config_path = model_root. join ( "config.json" ) ;
110110 let config = fs:: read_to_string ( config_path) . context ( "`config.json` not found" ) ?;
111+ tracing:: info!( "config contains {:?}" , config) ;
111112 let config: ModelConfig =
112113 serde_json:: from_str ( & config) . context ( "Failed to parse `config.json`" ) ?;
113114
@@ -181,7 +182,7 @@ pub async fn run(
181182 || & config. model_type == "camembert"
182183 || & config. model_type == "roberta"
183184 {
184- config. pad_token_id + 1
185+ config. pad_token_id . unwrap_or ( 0 ) + 1
185186 } else {
186187 0
187188 } ;
@@ -459,7 +460,7 @@ pub struct ModelConfig {
459460 #[ serde( alias = "n_positions" ) ]
460461 pub max_position_embeddings : usize ,
461462 #[ serde( default ) ]
462- pub pad_token_id : usize ,
463+ pub pad_token_id : Option < usize > ,
463464 pub id2label : Option < HashMap < String , String > > ,
464465 pub label2id : Option < HashMap < String , usize > > ,
465466 pub auto_map : Option < HashMap < String , String > > ,
You can’t perform that action at this time.
0 commit comments