Spaces:
Runtime error
Runtime error
Download vms/utils/parse_bool_env.py from vimalvskl7/VideoModelStudio: direct link, hf CLI and curl.
- Browser
- Download file 444 Bytes
-
https://huggingface.co/spaces/vimalvskl7/VideoModelStudio/resolve/main/vms/utils/parse_bool_env.py
- Command line
-
hf download hf://spaces/vimalvskl7/VideoModelStudio/vms/utils/parse_bool_env.py
-
curl -L -o parse_bool_env.py https://huggingface.co/spaces/vimalvskl7/VideoModelStudio/resolve/main/vms/utils/parse_bool_env.py
444 Bytes
| from typing import Any, Optional, Dict, List, Union, Tuple | |
| def parse_bool_env(env_value: Optional[str]) -> bool: | |
| """Parse environment variable string to boolean | |
| Handles various true/false string representations: | |
| - True: "true", "True", "TRUE", "1", etc | |
| - False: "false", "False", "FALSE", "0", "", None | |
| """ | |
| if not env_value: | |
| return False | |
| return str(env_value).lower() in ('true', '1', 't', 'y', 'yes') | |