MCPcopy Index your code
hub / github.com/mudler/LocalAI / test_load_model

Method test_load_model

backend/python/mlx/test.py:44–59  ·  view source on GitHub ↗

This method tests if the model is loaded successfully

(self)

Source from the content-addressed store, hash-verified

42 finally:
43 self.tearDown()
44 def test_load_model(self):
45 """
46 This method tests if the model is loaded successfully
47 """
48 try:
49 self.setUp()
50 with grpc.insecure_channel("localhost:50051") as channel:
51 stub = backend_pb2_grpc.BackendStub(channel)
52 response = stub.LoadModel(backend_pb2.ModelOptions(Model="mlx-community/Llama-3.2-1B-Instruct-4bit"))
53 self.assertTrue(response.success)
54 self.assertEqual(response.message, "MLX model loaded successfully")
55 except Exception as err:
56 print(err)
57 self.fail("LoadModel service failed")
58 finally:
59 self.tearDown()
60
61 def test_text(self):
62 """

Callers

nothing calls this directly

Calls 3

setUpMethod · 0.95
tearDownMethod · 0.95
LoadModelMethod · 0.65

Tested by

no test coverage detected