Instructions to use Canstralian/CyberAttackDetection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Canstralian/CyberAttackDetection with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Canstralian/CyberAttackDetection")# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSequenceClassification model = AutoModelForSequenceClassification.from_pretrained("Canstralian/CyberAttackDetection", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download utils.py from Canstralian/CyberAttackDetection: direct link, hf CLI and curl.
- Browser
- Download file 460 Bytes
-
https://huggingface.co/Canstralian/CyberAttackDetection/resolve/refs%2Fpr%2F1/utils.py
- Command line
-
hf download hf://Canstralian/CyberAttackDetection@refs/pr/1/utils.py
-
curl -L -o utils.py https://huggingface.co/Canstralian/CyberAttackDetection/resolve/refs%2Fpr%2F1/utils.py
460 Bytes
| import json | |
| from prompts import PROMPTS | |
| def get_prompt(vulnerability_type): | |
| """ | |
| Fetch the prompt for a specific vulnerability type. | |
| """ | |
| return PROMPTS.get(vulnerability_type, "No prompt available for this type.") | |
| def save_results(output, file_name="results.json"): | |
| """ | |
| Save the results to a JSON file. | |
| """ | |
| with open(file_name, "w") as file: | |
| json.dump(output, file, indent=4) | |
| print(f"Results saved to {file_name}") | |