model loading:

import torch
from transformers import (
AutoTokenizer,
AutoModelForSequenceClassification,
)

model_name = "AyaHazem61/araBERT-For-Hate-Speech-Detection"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(
model_name,
num_labels=2
)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)

model predicting:

texts = ["السلام عليكم و رحمة الله و بركاته"]
inputs = tokenizer(texts , return_tensors="pt", padding="max_length", truncation=True, max_length=512)

model .eval()
with torch.no_grad():
outputs = model (**inputs)

logits = outputs.logits
Downloads last month
10
Safetensors
Model size
135M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for AyaHazem61/araBERT-For-Hate-Speech-Detection

Finetuned
(4009)
this model

Dataset used to train AyaHazem61/araBERT-For-Hate-Speech-Detection