MCPcopy
hub / github.com/mudler/LocalAI / test_text

Method test_text

backend/python/mlx-distributed/test.py:57–71  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

55 self.tearDown()
56
57 def test_text(self):
58 try:
59 self.setUp()
60 with grpc.insecure_channel("localhost:50051") as channel:
61 stub = backend_pb2_grpc.BackendStub(channel)
62 response = stub.LoadModel(backend_pb2.ModelOptions(Model="mlx-community/Llama-3.2-1B-Instruct-4bit"))
63 self.assertTrue(response.success)
64 req = backend_pb2.PredictOptions(Prompt="The capital of France is")
65 resp = stub.Predict(req)
66 self.assertIsNotNone(resp.message)
67 except Exception as err:
68 print(err)
69 self.fail("text service failed")
70 finally:
71 self.tearDown()
72
73 def test_sampling_params(self):
74 try:

Callers

nothing calls this directly

Calls 4

setUpMethod · 0.95
tearDownMethod · 0.95
LoadModelMethod · 0.65
PredictMethod · 0.65

Tested by

no test coverage detected