logo
Browse Source

Update loader

Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
main
shiyu22 2 years ago
parent
commit
e6550b1440
  1. 5
      __init__.py
  2. 16
      loader.py

5
__init__.py

@ -0,0 +1,5 @@
from .loader import TextLoader
def text_loader(*args, **kwargs):
return TextLoader(*args, **kwargs)

16
loader.py

@ -0,0 +1,16 @@
from towhee.operator import PyOperator
class TextLoader(PyOperator):
"""
DefaultOperator for _input and _output nodes.
"""
def __init__(self):
#pylint: disable=useless-super-delegation
super().__init__()
def __call__(self, *args):
if len(args) == 1:
return args[0]
return args
Loading…
Cancel
Save