File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -19,4 +19,8 @@ pub enum TensorRtLlmBackendError {
1919 WebServer ( #[ from] server:: WebServerError ) ,
2020 #[ error( "Tokio runtime failed to start: {0}" ) ]
2121 Tokio ( #[ from] std:: io:: Error ) ,
22+ #[ error( "config.json doesn't exist in engine folder {0}" ) ]
23+ ConfigNotFound ( PathBuf ) ,
24+ #[ error( "generation_config.json doesn't exist in engine folder {0}" ) ]
25+ GenerationConfigNotFound ( PathBuf ) ,
2226}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use cxx::UniquePtr;
33use hashbrown:: HashMap ;
44use std:: hint;
55use std:: ops:: Deref ;
6- use std:: path:: Path ;
6+ use std:: path:: { Path , PathBuf } ;
77use tokenizers:: Tokenizer ;
88use tokio:: sync:: mpsc:: { unbounded_channel, UnboundedReceiver , UnboundedSender } ;
99use tokio:: sync:: TryAcquireError ;
@@ -283,6 +283,26 @@ fn ensure_paths_exist<P: AsRef<Path>, PP: AsRef<Path>>(
283283 return Err ( err) ;
284284 }
285285
286+ let mut config_path = PathBuf :: from ( engine_folder) ;
287+ config_path. push ( "config.json" ) ;
288+
289+ if !config_path. exists ( ) {
290+ let err = TensorRtLlmBackendError :: ConfigNotFound ( engine_folder. to_path_buf ( ) ) ;
291+
292+ error ! ( "Path validation failed: {}" , err, ) ;
293+ return Err ( err) ;
294+ }
295+
296+ let mut generation_config_path = PathBuf :: from ( engine_folder) ;
297+ generation_config_path. push ( "generation_config.json" ) ;
298+
299+ if !generation_config_path. exists ( ) {
300+ let err = TensorRtLlmBackendError :: GenerationConfigNotFound ( engine_folder. to_path_buf ( ) ) ;
301+
302+ error ! ( "Path validation failed: {}" , err, ) ;
303+ return Err ( err) ;
304+ }
305+
286306 // Ensure executor worker binary exists
287307 if !executor_worker_path. exists ( ) {
288308 let err = TensorRtLlmBackendError :: ExecutorWorkerNotFound ( engine_folder. to_path_buf ( ) ) ;
You can’t perform that action at this time.
0 commit comments