deeppavlov/core/commands/infer.py
def interact_model(config: Union[str, Path, dict]) -> None:
    """Start interaction with the model described in corresponding configuration file."""
    model = build_model(config)

    while True:
        args = []
        for in_x in model.in_x:
            args.append((input('{}::'.format(in_x)),))
            # check for exit command
            if args[-1][0] in {'exit', 'stop', 'quit', 'q'}:
                return

        pred = model(*args)
        if len(model.out_params) > 1:
            pred = zip(*pred)

        print('>>', *pred)
def interact_model(config: Union[str, Path, dict]) -> None:
    model = build_model(config)

    while True:
        args = []
        for in_x in model.in_x:
            args.append((input('{}::'.format(in_x)),))
            # check for exit command
            if args[-1][0] in {'exit', 'stop', 'quit', 'q'}:
                return

        pred = model(*args)
        if len(model.out_params) > 1:
            pred = zip(*pred)

        print('>>', *pred)
def interact_model ( config : Union [ str , Path , dict ] ) -> None : model = build_model ( config ) while True : args = [ ] for in_x in model . in_x : args . append ( ( input ( '{}::' . format ( in_x ) ) , ) ) # check for exit command if args [ - 1 ] [ 0 ] in { 'exit' , 'stop' , 'quit' , 'q' } : return pred = model ( * args ) if len ( model . out_params ) > 1 : pred = zip ( * pred ) print ( '>>' , * pred )
Start interaction with the model described in corresponding configuration file.
Start interaction with the model described in corresponding configuration file .