Replace import statement with langflow.custom
This commit is contained in:
parent
660b62bc08
commit
868d5fbb52
1 changed files with 3 additions and 0 deletions
|
|
@ -157,6 +157,9 @@ def create_class(code, class_name):
|
||||||
if not hasattr(ast, "TypeIgnore"):
|
if not hasattr(ast, "TypeIgnore"):
|
||||||
ast.TypeIgnore = create_type_ignore_class()
|
ast.TypeIgnore = create_type_ignore_class()
|
||||||
|
|
||||||
|
# Replace from langflow import CustomComponent with from langflow.custom import CustomComponent
|
||||||
|
code = code.replace("from langflow import CustomComponent", "from langflow.custom import CustomComponent")
|
||||||
|
|
||||||
module = ast.parse(code)
|
module = ast.parse(code)
|
||||||
exec_globals = prepare_global_scope(code, module)
|
exec_globals = prepare_global_scope(code, module)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue