## Motivation Current actor class has method https://github.com/hpcaitech/ColossalAI/blob/b0ce5a10326912961f0bc07cbbd250bab7b9c399/applications/Chat/coati/models/base/actor.py#L28 which makes strategy complex. In strategy, it must check whether the model is `Actor`: https://github.com/hpcaitech/ColossalAI/blob/a98af186600a80516d3413438c92c595fed6bc6e/applications/Chat/coati/trainer/strategies/base.py#L72 This makes developer confused. ## Goal Make `Actor` class clearer. ## Roadmap - [ ] Check whether it's training in `forward()` of `Actor`. If not, returns the original output of LM model. - [ ] Extract `generate()` method of `Actor` to a function. - [ ] Update naive experience maker. - [ ] Refactor `unwrap_model()` method of `Strategy`, which should return the original model before `prepare()`. - [ ] Refactor `get_base_model()` function, which should return the base HF model. This should be called after being unwrapped. - [ ] Refactor `prepare()` method of `Strategy`.
Motivation
Current actor class has method
ColossalAI/applications/Chat/coati/models/base/actor.py
Line 28 in b0ce5a1
In strategy, it must check whether the model is
Actor:ColossalAI/applications/Chat/coati/trainer/strategies/base.py
Line 72 in a98af18
This makes developer confused.
Goal
Make
Actorclass clearer.Roadmap
forward()ofActor. If not, returns the original output of LM model.generate()method ofActorto a function.unwrap_model()method ofStrategy, which should return the original model beforeprepare().get_base_model()function, which should return the base HF model. This should be called after being unwrapped.prepare()method ofStrategy.