towhee
/
text-loader
copied
2 changed files with 21 additions and 0 deletions
@ -0,0 +1,5 @@ |
|||||
|
from .loader import TextLoader |
||||
|
|
||||
|
|
||||
|
def text_loader(*args, **kwargs): |
||||
|
return TextLoader(*args, **kwargs) |
@ -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…
Reference in new issue