Spaces:
Paused
Paused
Download src/backend/utils.py from chinpeerapat/be-deepseek: direct link, hf CLI and curl.
- Browser
- Download file 383 Bytes
-
https://huggingface.co/spaces/chinpeerapat/be-deepseek/resolve/main/src/backend/utils.py
- Command line
-
hf download hf://spaces/chinpeerapat/be-deepseek/src/backend/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/chinpeerapat/be-deepseek/resolve/main/src/backend/utils.py
383 Bytes
| from backend.constants import ChatModel | |
| def is_local_model(model: ChatModel) -> bool: | |
| return model in [ | |
| ChatModel.LOCAL_LLAMA_3, | |
| ChatModel.LOCAL_GEMMA, | |
| ChatModel.LOCAL_MISTRAL, | |
| ChatModel.LOCAL_PHI3_14B, | |
| ] | |
| def strtobool(val: str | bool) -> bool: | |
| if isinstance(val, bool): | |
| return val | |
| return val.lower() in ("true", "1", "t") | |