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

Method test_text

backend/python/mlx/test.py:61–78  ·  view source on GitHub ↗

This method tests if the embeddings are generated successfully

(self)

Source from the content-addressed store, hash-verified

59 self.tearDown()
60
61 def test_text(self):
62 """
63 This method tests if the embeddings are generated successfully
64 """
65 try:
66 self.setUp()
67 with grpc.insecure_channel("localhost:50051") as channel:
68 stub = backend_pb2_grpc.BackendStub(channel)
69 response = stub.LoadModel(backend_pb2.ModelOptions(Model="mlx-community/Llama-3.2-1B-Instruct-4bit"))
70 self.assertTrue(response.success)
71 req = backend_pb2.PredictOptions(Prompt="The capital of France is")
72 resp = stub.Predict(req)
73 self.assertIsNotNone(resp.message)
74 except Exception as err:
75 print(err)
76 self.fail("text service failed")
77 finally:
78 self.tearDown()
79
80 def test_sampling_params(self):
81 """

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