-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change default batch_size for finetuning to max_batch_size for a model (
#189) * add code * add auto * style * fix handlers * auto to max * renaming * add warning message * some fixes * new warning msg
- Loading branch information
1 parent
ec0772b
commit f13c7a1
Showing
9 changed files
with
210 additions
and
24 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,21 @@ | ||
import click | ||
|
||
from typing import Literal | ||
|
||
|
||
class AutoIntParamType(click.ParamType): | ||
name = "integer" | ||
|
||
def convert( | ||
self, value: str, param: click.Parameter | None, ctx: click.Context | None | ||
) -> int | Literal["max"] | None: | ||
if isinstance(value, int): | ||
return value | ||
|
||
if value == "max": | ||
return "max" | ||
|
||
self.fail("Invalid integer value: {value}") | ||
|
||
|
||
INT_WITH_MAX = AutoIntParamType() |
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
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
Oops, something went wrong.