File size: 968 Bytes
88597ff | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | '''
-----------------------------------------------------------------------------
Copyright (c) 2023, ai-study-room. All rights reserved.
Authors: freesky-edward
This source code or documentation is under the license under the
LICENSE file in the root directory of this repository
-----------------------------------------------------------------------------
'''
class BaseInference(object):
r"""
BaseInference is the abstract class that all model inherit this
to predict or generate the new text or image.
Args:
cfg(obj): The configuration of the inference. see Config object in config.py
"""
def __init__(self, cfg):
super().__init__()
self.cfg = cfg
def generate(self, msg: list[tuple[str, str]], kwargs):
r'''
Provide the basic interface that return the generative text by a given model
Args:
msg(str): The prompt under a context dialog.
'''
pass
|