Download Brain/src/rising_plugin/rails_validate.py from posix4e/brain: direct link, hf CLI and curl.
- Browser
- Download file 413 Bytes
-
https://huggingface.co/spaces/posix4e/brain/resolve/main/Brain/src/rising_plugin/rails_validate.py
- Command line
-
hf download hf://spaces/posix4e/brain/Brain/src/rising_plugin/rails_validate.py
-
curl -L -o rails_validate.py https://huggingface.co/spaces/posix4e/brain/resolve/main/Brain/src/rising_plugin/rails_validate.py
413 Bytes
| """validate rails result: | |
| checking with program whether is it message or rails_off_topic""" | |
| import json | |
| from Brain.src.common.program_type import ProgramType | |
| def validate_rails(data: str) -> bool: | |
| try: | |
| json_obj = json.loads(data["content"]) | |
| if json_obj["program"] == ProgramType.RAILS_OFF_TOPIC: | |
| return False | |
| return True | |
| except Exception as ex: | |
| return False | |