MCPcopy Index your code
hub / github.com/OptimalScale/LMFlow / test_decode

Method test_decode

tests/models/test_hf_decoder_model.py:640–648  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

638
639
640 def test_decode(self):
641 model_name = 'gpt2'
642 model_args = ModelArguments(model_name_or_path=model_name)
643 model = HFDecoderModel(model_args)
644 self.assertEqual(model.decode(test_decode_input), test_decode_output)
645
646 batch_decode_input = [test_decode_input] * 2
647 batch_decode_output = [test_decode_output] * 2
648 self.assertEqual(model.decode(batch_decode_input), batch_decode_output)
649
650
651 def test_inference(self):

Callers

nothing calls this directly

Calls 3

decodeMethod · 0.95
ModelArgumentsClass · 0.90
HFDecoderModelClass · 0.90

Tested by

no test coverage detected