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

Method test_inference

backend/python/liquid-audio/test.py:65–85  ·  view source on GitHub ↗

End-to-end: load a real LFM2-Audio model and run one short prediction.

(self)

Source from the content-addressed store, hash-verified

63 @unittest.skipUnless(os.environ.get("LIQUID_AUDIO_MODEL_ID"),
64 "Set LIQUID_AUDIO_MODEL_ID to run an end-to-end inference smoke test")
65 def test_inference(self):
66 """End-to-end: load a real LFM2-Audio model and run one short prediction."""
67 stub = self._stub()
68 model_id = os.environ["LIQUID_AUDIO_MODEL_ID"]
69 result = stub.LoadModel(
70 backend_pb2.ModelOptions(
71 Model=model_id,
72 Options=["mode:chat"],
73 ),
74 timeout=600,
75 )
76 self.assertTrue(result.success, msg=result.message)
77 reply = stub.Predict(
78 backend_pb2.PredictOptions(
79 Prompt="Hello!",
80 Tokens=8,
81 Temperature=0.0,
82 ),
83 timeout=120,
84 )
85 self.assertGreater(len(reply.message), 0)
86
87
88if __name__ == "__main__":

Callers

nothing calls this directly

Calls 3

_stubMethod · 0.95
LoadModelMethod · 0.65
PredictMethod · 0.65

Tested by

no test coverage detected