예제 #1
0
 def __init__(self,
              model: 'core.Model',
              server: Server,
              debug: bool = False):
     from ebonite.runtime.interface.ml_model import ModelLoader
     super().__init__(server, ModelLoader(), debug)
     self.model = model
예제 #2
0
def test_python_builder__distr_loadable(tmpdir, python_builder, created_model,
                                        pandas_data, request):
    python_builder: PythonBuilder = request.getfixturevalue(python_builder)
    prediction = created_model.wrapper.call_method('predict', pandas_data)

    with use_local_installation():
        python_builder._write_distribution(tmpdir)

    iface = _load(ModelLoader(), tmpdir)
    prediction2 = iface.execute('predict', {'vector': pandas_data})

    np.testing.assert_almost_equal(prediction, prediction2)
예제 #3
0
파일: test_base.py 프로젝트: zyfra/ebonite
def test_python_build_context__distr_loadable(tmpdir, python_build_context,
                                              created_model, pandas_data,
                                              request):
    python_build_context: PythonBuildContext = request.getfixturevalue(
        python_build_context)
    prediction = created_model.wrapper.call_method('predict', pandas_data)

    with use_local_installation():
        python_build_context._write_distribution(tmpdir)

    assert python_build_context.provider.get_python_version(
    ) == platform.python_version()

    iface = _load(ModelLoader(), tmpdir)
    prediction2 = iface.execute('predict', {'vector': pandas_data})

    np.testing.assert_almost_equal(prediction, prediction2)