class_docstr: Test that model classes conform to the expected spec.
class_docstr_tok: ["Test","that","model","classes","conform","to","the","expected","spec","."]
code: def test_model_specs(self):
      model = tydi.TyDiModel(
          "TyDiModel", model="dummy", tokenizer="dummy"
      )
      # Check inputs
      ispec = model.input_spec()
      self.assertIn("context", ispec)
      self.assertIsInstance(ispec["context"], lit_types.TextSegment)
      self.assertIn("answers_text", ispec)
      self.assertIsInstance(
          ispec["answers_text"], lit_types.MultiSegmentAnnotations
      )
  
      # Check outputs
      ospec = model.output_spec()
      self.assertIn("generated_text", ospec)
      self.assertIsInstance(
          ospec["generated_text"], lit_types.GeneratedText
      )
      self.assertEqual(ospec["generated_text"].parent, "answers_text")
  
imports: from absl.testing import absltest
  from lit_nlp.api import types
  from lit_nlp.examples.models import tydi
label_desc: Use image node_id 1 for calling the TyDiModelTest obj's underlying member method code with example usage: obj.test_model_specs() without return types