This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] Add support for schedulers (#232)
* add support for schedulers * update changelog * resolve typing * update task * change for log softmax * udpate on comments
- Loading branch information
Showing
6 changed files
with
170 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from typing import Callable, List | ||
|
||
from flash.core.registry import FlashRegistry | ||
from flash.utils.imports import _TRANSFORMERS_AVAILABLE | ||
|
||
_SCHEDULERS_REGISTRY = FlashRegistry("scheduler") | ||
|
||
if _TRANSFORMERS_AVAILABLE: | ||
from transformers import optimization | ||
functions: List[Callable] = [ | ||
getattr(optimization, n) for n in dir(optimization) if ("get_" in n and n != 'get_scheduler') | ||
] | ||
for fn in functions: | ||
_SCHEDULERS_REGISTRY(fn, name=fn.__name__[4:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters