MCPcopy Create free account
hub / github.com/Kaggle/docker-python / test_fit

Method test_fit

tests/test_keras_nlp.py:10–19  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

8
9class TestKerasNLP(unittest.TestCase):
10 def test_fit(self):
11 with create_test_kagglehub_server():
12 classifier = keras_nlp.models.BertClassifier.from_preset(
13 'bert_tiny_en_uncased',
14 load_weights=False, # load randomly initialized model from preset architecture with weights
15 num_classes=2,
16 activation="softmax",
17 )
18 result = classifier.predict(['What an amazing movie!'])
19 self.assertEqual((1, 2), result.shape)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected