Downloads · 30 days
12
3% of all-time downloads
irlab-udc/Mistral-7b-Stop-Hate
Mistral-7b-Stop-Hate is a text generation model from irlab-udc. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
This model was created as part of the work "Decoding Hate: Exploring Language Models' Reactions to Hate Speech," which was accepted for the main conference of NAACL 2025.
Downloads · 30 days
12
3% of all-time downloads
All-time downloads
354
Public
Repo size
343 MB
Likes
1
Public
Click a slice to open those files.
.bin340 MB · 99%
From the Hugging Face model README
This model was created as part of the work "Decoding Hate: Exploring Language Models' Reactions to Hate Speech," which was accepted for the main conference of NAACL 2025.
This model is a fine-tuned version of mistralai/Mistral-7B-Instruct-v0.2 on a hate speech dataset using the PEFT approach, to prevent the model from exacerbating hate discourse.
This model is intended for research purposes in conversational applications to stop hate speech generation.
Use the code below to get started with the model.
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer, Conversation, pipeline
# Load the model
config = PeftConfig.from_pretrained("irlab-udc/Mistral-7b-Stop-Hate")
base_model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2", config=config)
model = PeftModel.from_pretrained(base_model, "irlab-udc/Mistral-7b-Stop-Hate")
tokenizer = AutoTokenizer.from_pretrained("irlab-udc/Mistral-7b-Stop-Hate")
# Test the model
chatbot = pipeline(task="conversational", model=model, tokenizer=tokenizer)
conversation = Conversation("Your input text here")
conversation = chatbot(conversation)
result = conversation.messages[-1]["content"]
The following LoraConfig config was used during training:
The following TrainingArguments config was used during training:
The following bitsandbytes quantization config was used during training:
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
If you use this model, please cite the following reference:
@misc{piot2024decodinghateexploringlanguage,
title={Decoding Hate: Exploring Language Models' Reactions to Hate Speech},
author={Paloma Piot and Javier Parapar},
year={2024},
eprint={2410.00775},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2410.00775},
}
The authors thank the funding from the Horizon Europe research and innovation programme under the Marie Skłodowska-Curie Grant Agreement No. 101073351. The authors also thank the financial support supplied by the Consellería de Cultura, Educación, Formación Profesional e Universidades (accreditation 2019-2022 ED431G/01, ED431B 2022/33) and the European Regional Development Fund, which acknowledges the CITIC Research Center in ICT of the University of A Coruña as a Research Center of the Galician University System and the project PID2022-137061OB-C21 (Ministerio de Ciencia e Innovación, Agencia Estatal de Investigación, Proyectos de Generación de Conocimiento; supported by the European Regional Development Fund). The authors also thank the funding of project PLEC2021-007662 (MCIN/AEI/10.13039/501100011033, Ministerio de Ciencia e Innovación, Agencia Estatal de Investigación, Plan de Recuperación, Transformación y Resiliencia, Unión Europea-Next Generation EU).