Download test_handler.py from grammarly/brain_query_to_pack_classifier: direct link, hf CLI and curl.
- Browser
- Download file 755 Bytes
-
https://huggingface.co/grammarly/brain_query_to_pack_classifier/resolve/main/test_handler.py
- Command line
-
hf download hf://grammarly/brain_query_to_pack_classifier/test_handler.py
-
curl -L -o test_handler.py https://huggingface.co/grammarly/brain_query_to_pack_classifier/resolve/main/test_handler.py
755 Bytes
| from handler import EndpointHandler | |
| print('Loading EndpointHandler...') | |
| # Initialize handler with current directory as model path | |
| my_handler = EndpointHandler(path=".") | |
| # Define test inputs | |
| test_payload_1 = {"inputs": "security breach procedure template"} | |
| test_payload_2 = {"inputs": "HR team daily briefing meetup"} | |
| test_payload_3 = {"inputs": "repositories on market sentiment trends"} | |
| print('Testing queries...') | |
| # Run predictions | |
| pred_1 = my_handler(test_payload_1) | |
| pred_2 = my_handler(test_payload_2) | |
| pred_3 = my_handler(test_payload_3) | |
| # Print outputs | |
| print("Query 1: security breach procedure template -> ", pred_1) | |
| print("Query 2: HR team daily briefing meetup -> ", pred_2) | |
| print("Query 3: repositories on market sentiment trends -> ", pred_3) | |