(task_name, inputs, model_cls, checkpoint=-1)
return _run_model_loaded(model, batch)
Run inference on an input sentence. 
    Parameters:
        task_name: Name of the task as provided during training
        inputs: Input sentence Either a string or a list of strings
        model_cls: Model class name. Must be same as used during training
        checkpoint: Checkpoint number (train iteration) to load from. -1 for
                    best/latest checkpoint
Run inference on an input sentence. 
    Parameters:
        task_name: Name of the task as provided during training
        inputs: Input sentence Either a string or a list of strings
        model_cls: Model class name. Must be same as used during training
        checkpoint: Checkpoint number (train iteration) to load from. -1 for
                    best/latest checkpoint
Run inference on an input sentence . Parameters : task_name : Name of the task as provided during training inputs : Input sentence Either a string or a list of strings model_cls : Model class name . Must be same as used during training checkpoint : Checkpoint number ( train iteration ) to load from . - 1 for best / latest checkpoint
def infer(task_name, inputs, model_cls, checkpoint=-1):
    """
    Run inference on an input sentence. 
    Parameters:
        task_name: Name of the task as provided during training
        inputs: Input sentence Either a string or a list of strings
        model_cls: Model class name. Must be same as used during training
        checkpoint: Checkpoint number (train iteration) to load from. -1 for
                    best/latest checkpoint
    """
    task_name = task_name or PREFS.cur_task
    model = model_cls.load(task_name, checkpoint)
    
    vocab_word, vocab_char, _ = model.vocabs
    input_fn = get_input_processor_words(vocab_word, vocab_char)

    batch = input_fn(inputs)
    
    return _run_model_loaded(model, batch)
def infer ( task_name , inputs , model_cls , checkpoint = - 1 ) : task_name = task_name or PREFS . cur_task model = model_cls . load ( task_name , checkpoint ) vocab_word , vocab_char , _ = model . vocabs input_fn = get_input_processor_words ( vocab_word , vocab_char ) batch = input_fn ( inputs ) return _run_model_loaded ( model , batch )