Skip to content

Commit

Permalink
try to generate a new model in order to match context versions [try t…
Browse files Browse the repository at this point in the history
…o fix websocket issue]
  • Loading branch information
AHReccese committed Jan 15, 2025
1 parent da884fa commit 6b0c4fc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_ml_streaming/test_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
from scenarios.scenario2 import scenario2
from scenarios.scenario3 import scenario3

from pymilo import Export
from sklearn.linear_model import LinearRegression
from pymilo.utils.data_exporter import prepare_simple_regression_datasets


@pytest.fixture(
scope="session",
Expand Down Expand Up @@ -34,14 +38,21 @@ def prepare_bare_server(request):
def prepare_ml_server(request):
communication_protocol = request.param
compression_method = "ZLIB"

x_train, y_train, _, _ = prepare_simple_regression_datasets()
linear_regression = LinearRegression()
linear_regression.fit(x_train, y_train)
Export(linear_regression).save('linear_model.json')

server_proc = subprocess.Popen(
[
executable,
"-m", "pymilo",
"--compression", compression_method,
"--protocol", communication_protocol,
"--port", "9000",
"--load", os.path.join(os.getcwd(), "tests", "test_exceptions", "valid_jsons", "linear_regression.json")
"--load", os.path.join(os.getcwd(), "linear_model.json")
# "--load", os.path.join(os.getcwd(), "tests", "test_exceptions", "valid_jsons", "linear_regression.json")
# "--load", "https://raw.githubusercontent.com/openscilab/pymilo/main/tests/test_exceptions/valid_jsons/linear_regression.json",
],
)
Expand Down

0 comments on commit 6b0c4fc

Please sign in to comment.