You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f"multiple definitions for {target_class_name} class found; please check your imports and class definitions and ensure that there is only one Predictor class definition"
264
-
)
265
-
predictor_class=class_df[1]
266
-
ifpredictor_classisNone:
267
-
raiseUserException(f"{target_class_name} class is not defined")
raiseUserException("unable to load pickle", str(e)) frome
287
-
else:
288
-
try:
289
-
impl=imp.load_source(module_name, impl_path)
290
-
exceptExceptionase:
291
-
raiseUserException(str(e)) frome
292
274
293
-
returnimpl
275
+
try:
276
+
impl=imp.load_source(module_name, impl_path)
277
+
exceptExceptionase:
278
+
raiseUserException(str(e)) frome
279
+
280
+
classes=inspect.getmembers(impl, inspect.isclass)
281
+
predictor_class=None
282
+
forclass_dfinclasses:
283
+
ifclass_df[0] ==target_class_name:
284
+
ifpredictor_classisnotNone:
285
+
raiseUserException(
286
+
f"multiple definitions for {target_class_name} class found; please check your imports and class definitions and ensure that there is only one Predictor class definition"
287
+
)
288
+
predictor_class=class_df[1]
289
+
ifpredictor_classisNone:
290
+
raiseUserException(f"{target_class_name} class is not defined")
0 commit comments