This method tests if the embeddings are generated successfully
(self)
| 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 | """ |