Instructions to use CyberPeace-Institute/Cybersecurity-Knowledge-Graph with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CyberPeace-Institute/Cybersecurity-Knowledge-Graph with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="CyberPeace-Institute/Cybersecurity-Knowledge-Graph", trust_remote_code=True)# Load model directly from transformers import AutoModelForTokenClassification model = AutoModelForTokenClassification.from_pretrained("CyberPeace-Institute/Cybersecurity-Knowledge-Graph", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
12c5ec6
1
Parent(s): 1fb2ae2
Upload model
Browse files
model.py
CHANGED
|
@@ -58,7 +58,6 @@ class CybersecurityKnowledgeGraphModel(PreTrainedModel):
|
|
| 58 |
predicted_label = []
|
| 59 |
for batch in dataloader:
|
| 60 |
with torch.no_grad():
|
| 61 |
-
print(batch.keys())
|
| 62 |
logits = model(**batch)
|
| 63 |
|
| 64 |
batch_predicted_label = logits.argmax(-1)
|
|
|
|
| 58 |
predicted_label = []
|
| 59 |
for batch in dataloader:
|
| 60 |
with torch.no_grad():
|
|
|
|
| 61 |
logits = model(**batch)
|
| 62 |
|
| 63 |
batch_predicted_label = logits.argmax(-1)
|