Fix config override bug by recreating LMs after load_state
This commit is contained in:
@@ -277,10 +277,11 @@ class RLMCodingProgram(PrecompiledProgram):
|
|||||||
|
|
||||||
PrecompiledProgram.from_precompiled() calls load_state() AFTER __init__,
|
PrecompiledProgram.from_precompiled() calls load_state() AFTER __init__,
|
||||||
which overwrites our LMs with saved state. We fix this by recreating
|
which overwrites our LMs with saved state. We fix this by recreating
|
||||||
the LMs from self.config after the parent load_state runs.
|
the LMs from self.config after the parent load_state runs. Modaic will
|
||||||
|
fix this in a later patch for future devs.
|
||||||
"""
|
"""
|
||||||
super().load_state(state)
|
super().load_state(state)
|
||||||
# Recreate LMs from config (not from saved state)
|
# recreate LMs from config (not from saved state)
|
||||||
self.reload_lms()
|
self.reload_lms()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user