Environment
str2bool(value)
ΒΆ
Convert a string or boolean value to a boolean.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Union[str, bool]
|
The value to convert. Can be either a string ('true'/'false') or a boolean value. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
The boolean value. Returns True for 'true' (case-insensitive) or True input, False for 'false' (case-insensitive) or False input. |
Raises:
Type | Description |
---|---|
ValueError
|
If the input string is not 'true' or 'false' (case-insensitive). |
Source code in inference_sdk/utils/environment.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|