Downloads · 30 days
0
linndfors/uk-gender-swapper-aya-101
uk-gender-swapper-aya-101 is a text generation model from linndfors. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This model is a PEFT-fine-tuned version of the aya-101 large language model, adapted for Ukrainian gender swapping. It is designed to generate gender-swapped versions of input sentences, making it useful for tasks inv…
Downloads · 30 days
0
Access
Public
Updated Jul 29, 2025
Repo size
6.3 GB
Likes
2
Public
Click a slice to open those files.
.safetensors6.3 GB · 100%
From the Hugging Face model README
This model is a PEFT-fine-tuned version of the aya-101 large language model, adapted for Ukrainian gender swapping. It is designed to generate gender-swapped versions of input sentences, making it useful for tasks involving gender bias mitigation, inclusive language generation, or synthetic dataset creation.
Model Type: Aya-101 (12.9B) + PEFT (LoRA)
Language: Ukrainian 🇺🇦
Task: Gender Swapping (Text-to-Text Generation)
You can use this model with the peft library and transformers. Here’s an example using the merged adapter:
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from peft import PeftModel, PeftConfig
adapter_repo_id = "linndfors/uk-sent-gender-swapper_aya-101"
config = PeftConfig.from_pretrained(adapter_repo_id)
base_model_id = config.base_model_name_or_path
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForSeq2SeqLM.from_pretrained(base_model_id)
base_model.resize_token_embeddings(len(tokenizer))
inference_model = PeftModel.from_pretrained(base_model, adapter_repo_id)
prefix = "Перефразуй це речення, змінивши гендерні сутності на протилежні (чоловічий <-> жіночий): "
def generate_swapped_response(input_text, inference_model, tokenizer):
inputs = tokenizer(prefix + input_text, return_tensors="pt")
with torch.no_grad():
outputs = inference_model.generate(**inputs, max_new_tokens=100, temperature=0.1)
generated = tokenizer.decode(outputs[0], skip_special_tokens=True)
return generated
input = "Він працює викладачем в університеті."
gender-swapped_output = generate_swapped_response(input, inference_model, tokenizer)
Input:
Він працює викладачем в університеті.
Output:
Вона працює викладачкою в університеті.
peftadapter_config.json – PEFT configurationadapter_model.bin – Fine-tuned LoRA weightsREADME.md – Descriptiontokenizer_config.json, tokenizer.model, etc. – Tokenizer files from the base modelIf you use this model in your work, please cite the original Aya-101 paper and consider crediting this repository:
@misc{linndfors2024ukgenderswapper,
title={uk-gender-swapper-aya-101},
author={Olha Nahurna},
year={2024},
howpublished={\url{https://huggingface.co/linndfors/uk-gender-swapper-aya-101}}
}
Feel free to open an issue or reach out via the Hugging Face discussion tab.