Skip to content

Commit

Permalink
Merge pull request #847 from deepmodeling/zjgemi
Browse files Browse the repository at this point in the history
fix: multiprocessing in debug mode
  • Loading branch information
zjgemi authored Aug 7, 2024
2 parents 09fb5d2 + fe6fdd2 commit da9ca61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dflow/python/python_op_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,8 @@ def render_script(self):
" handle_input_parameter\n"
script += "from dflow.python.utils import handle_output_artifact," \
" handle_output_parameter, handle_lineage\n"
script += f"from {mod} import {class_name}\n\n"
if mod not in ["__main__", "__mp_main__"]:
script += f"from {mod} import {class_name}\n\n"
if hasattr(op_class, "func"):
script += "op_obj = %s\n" % class_name
elif op is None:
Expand Down

0 comments on commit da9ca61

Please sign in to comment.