mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-04-28 03:43:01 +00:00
* [lazy] patch from pretrained * [lazy] fix from pretrained and add tests * [devops] update ci
17 lines
333 B
Python
17 lines
333 B
Python
from typing import Optional
|
|
|
|
from torch.nn import Module
|
|
|
|
__all__ = [
|
|
"get_pretrained_path",
|
|
"set_pretrained_path",
|
|
]
|
|
|
|
|
|
def get_pretrained_path(model: Module) -> Optional[str]:
|
|
return getattr(model, "_pretrained", None)
|
|
|
|
|
|
def set_pretrained_path(model: Module, path: str) -> None:
|
|
setattr(model, "_pretrained", path)
|