@@ -150,21 +150,18 @@ def _mock_truediv(*args):
150150 # Handle the case where it's called with just one argument
151151 if len (args ) == 1 :
152152 other = args [0 ]
153- if str (other ) == ".vec-inf-logs" :
154- return test_paths ["log_dir" ]
155- return Path (str (other ))
153+ return test_paths .get (other , Path (str (other )))
156154
157155 # Normal case with self and other
158156 self , other = args
159- if str (self ) == str (test_paths ["weights_dir" ]) and other == "unknown-model" :
160- return test_paths ["unknown_model" ]
161- if str (self ) == str (test_paths ["log_dir" ]):
162- return test_paths ["log_dir" ] / other
163- if str (self ) == str (test_paths ["log_dir" ] / "model_family_placeholder" ):
164- return test_paths ["log_dir" ] / "model_family_placeholder" / other
165- if str (self ) == "/home/user" and str (other ) == ".vec-inf-logs" :
166- return test_paths ["log_dir" ]
167- return Path (str (self )) / str (other )
157+ specific_paths = {
158+ (str (test_paths ["weights_dir" ]), "unknown-model" ): test_paths ["unknown_model" ],
159+ (str (test_paths ["log_dir" ]), other ): test_paths ["log_dir" ] / other ,
160+ (str (test_paths ["log_dir" ] / "model_family_placeholder" ), other ): test_paths ["log_dir" ] / "model_family_placeholder" / other ,
161+ ("/home/user" , ".vec-inf-logs" ): test_paths ["log_dir" ],
162+ }
163+
164+ return specific_paths .get ((str (self ), other ), Path (str (self )) / str (other ))
168165
169166 return _mock_truediv
170167
0 commit comments