Skip to content

Commit 4d7f117

Browse files
committed
Add from_config to sampler
Every class with a get_config should have a from_config somewhere in the super() chain. This is actually causing test failures on nightly.
1 parent e053f71 commit 4d7f117

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

keras_nlp/samplers/sampler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ def one_step(
377377
)
378378
return prompt
379379

380+
@classmethod
381+
def from_config(cls, config):
382+
return cls(**config)
383+
380384
def get_config(self):
381385
return {
382386
"jit_compile": self.jit_compile,

0 commit comments

Comments
 (0)