mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-08-13 05:35:38 +00:00
* feat: modify forward fn of critic and reward model * feat: modify calc_action_log_probs * to: add wandb in sft and rm trainer * feat: update train_sft * feat: update train_rm * style: modify type annotation and add warning * feat: pass tokenizer to ppo trainer * to: modify trainer base and maker base * feat: add wandb in ppo trainer * feat: pass tokenizer to generate * test: update generate fn tests * test: update train tests * fix: remove action_mask * feat: remove unused code * fix: fix wrong ignore_index * fix: fix mock tokenizer * chore: update requirements * revert: modify make_experience * fix: fix inference * fix: add padding side * style: modify _on_learn_batch_end * test: use mock tokenizer * fix: use bf16 to avoid overflow * fix: fix workflow * [chat] fix gemini strategy * [chat] fix * sync: update colossalai strategy * fix: fix args and model dtype * fix: fix checkpoint test * fix: fix requirements * fix: fix missing import and wrong arg * fix: temporarily skip gemini test in stage 3 * style: apply pre-commit * fix: temporarily skip gemini test in stage 1&2 --------- Co-authored-by: Mingyan Jiang <1829166702@qq.com>
40 lines
825 B
Python
40 lines
825 B
Python
from abc import ABC
|
|
|
|
from coati.experience_maker import Experience
|
|
|
|
|
|
class Callback(ABC):
|
|
"""
|
|
Base callback class. It defines the interface for callbacks.
|
|
"""
|
|
|
|
def on_fit_start(self) -> None:
|
|
pass
|
|
|
|
def on_fit_end(self) -> None:
|
|
pass
|
|
|
|
def on_episode_start(self, episode: int) -> None:
|
|
pass
|
|
|
|
def on_episode_end(self, episode: int) -> None:
|
|
pass
|
|
|
|
def on_make_experience_start(self) -> None:
|
|
pass
|
|
|
|
def on_make_experience_end(self, experience: Experience) -> None:
|
|
pass
|
|
|
|
def on_learn_epoch_start(self, epoch: int) -> None:
|
|
pass
|
|
|
|
def on_learn_epoch_end(self, epoch: int) -> None:
|
|
pass
|
|
|
|
def on_learn_batch_start(self) -> None:
|
|
pass
|
|
|
|
def on_learn_batch_end(self, experience: Experience) -> None:
|
|
pass
|