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

Class TestKerasNLP

tests/test_keras_nlp.py:9–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7from utils.kagglehub import create_test_kagglehub_server
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

no outgoing calls

Tested by

no test coverage detected