Download core/mode_handler.py from lhc-lab/AI-Colab: direct link, hf CLI and curl.
- Browser
- Download file 325 Bytes
-
https://huggingface.co/datasets/lhc-lab/AI-Colab/resolve/main/core/mode_handler.py
- Command line
-
hf download hf://datasets/lhc-lab/AI-Colab/core/mode_handler.py
-
curl -L -o mode_handler.py https://huggingface.co/datasets/lhc-lab/AI-Colab/resolve/main/core/mode_handler.py
325 Bytes
| from pathlib import Path | |
| def apply_mode_logic(message: str) -> str: | |
| """ | |
| Применяет логику режимов: если нет [TASK], добавляет инструкцию диалога. | |
| """ | |
| if message.startswith("[TASK]"): | |
| return message | |
| return message + "\nВеди диалог." | |