Beispiel #1
0
def fastai_learner():
    model = Model()
    loss = Loss()

    dblock = DataBlock(get_items=get_items, get_y=np.sum)
    dls = dblock.datasets(None).dataloaders()
    learner = Learner(dls, model, loss)
    return learner
Beispiel #2
0
def pack_models(path: str) -> None:

    model = LinearModel()
    loss = Loss()

    dblock = DataBlock(get_items=get_items, get_y=np.sum)
    dls = dblock.datasets(None).dataloaders()
    learner = Learner(dls, model, loss)

    FastAIModel(learner).save(path)
Beispiel #3
0
def pack_models(path):
    from bentoml.frameworks.fastai import FastaiModelArtifact

    model = Model()
    loss = Loss()

    dblock = DataBlock(get_items=get_items, get_y=np.sum)
    dls = dblock.datasets(None).dataloaders()
    learner = Learner(dls, model, loss)

    FastaiModelArtifact("model").pack(learner).save(path)