@@ -184,6 +184,14 @@ def build_scheduler_config(config: dict[str, Any]) -> tuple[FlowMatchEulerDiscre
184184 misc = _resolve_section (config , "misc" )
185185
186186 transport_params = transport .get ("params" , {})
187+ path_type = str (transport_params .get ("path_type" , "Linear" ))
188+ prediction = str (transport_params .get ("prediction" , "velocity" ))
189+ if path_type .lower () != "linear" or prediction .lower () != "velocity" :
190+ raise ValueError (
191+ "Only `transport.params.path_type=Linear` with `transport.params.prediction=velocity` is "
192+ "supported by this converter because it always saves a `FlowMatchEulerDiscreteScheduler`."
193+ )
194+
187195 latent_size = misc .get ("latent_size" , None )
188196 if latent_size is None :
189197 raise KeyError ("Config must define `misc.latent_size` for scheduler conversion." )
@@ -200,8 +208,8 @@ def build_scheduler_config(config: dict[str, Any]) -> tuple[FlowMatchEulerDiscre
200208 metadata = {
201209 "num_train_timesteps" : scheduler .config .num_train_timesteps ,
202210 "shift" : scheduler .config .shift ,
203- "path_type" : transport_params . get ( " path_type" , "Linear" ) ,
204- "prediction" : transport_params . get ( " prediction" , "velocity" ) ,
211+ "path_type" : path_type ,
212+ "prediction" : prediction ,
205213 "time_dist_type" : transport_params .get ("time_dist_type" , "uniform" ),
206214 }
207215 return scheduler , metadata
@@ -307,20 +315,27 @@ def write_metadata(output_path: Path, metadata: dict[str, Any]) -> None:
307315
308316
309317def resolve_input_path (accessor : RepoAccessor , path : str ) -> Path :
318+ expanded_path = Path (path ).expanduser ()
319+ if expanded_path .is_absolute ():
320+ if expanded_path .is_file ():
321+ return expanded_path
322+ raise FileNotFoundError (f"Absolute path does not exist: { expanded_path } " )
323+
310324 candidates = [path ]
311325 if path .startswith ("models/" ):
312326 candidates .append (path [len ("models/" ) :])
313327
314328 for candidate in candidates :
315- local_path = Path (candidate )
316- if local_path .is_file ():
317- return local_path
318-
319329 try :
320330 return accessor .fetch (candidate )
321331 except FileNotFoundError :
322332 continue
323333
334+ for candidate in candidates :
335+ local_path = Path (candidate ).expanduser ()
336+ if local_path .is_file ():
337+ return local_path
338+
324339 raise FileNotFoundError (f"Could not resolve `{ path } ` from `{ accessor .repo_or_path } `." )
325340
326341
0 commit comments