Instructions to use thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen3.5-2B-Base") model = PeftModel.from_pretrained(base_model, "thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b") - Transformers
How to use thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b
- SGLang
How to use thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b with Docker Model Runner:
docker model run hf.co/thunder121x/thai-gender-bias-span-extraction-qwen3.5-2b
Thai Gender Bias Span Extraction β Qwen 3.5 2B (LoRA)
LoRA adapter for unsloth/Qwen3.5-2B-Base that detects gender-biased spans in Thai
social-media text. Given Thai input, the model returns the same text with bias spans
wrapped in inline tags:
<GB-ATTACK>...</GB-ATTACK>β gender-based attacks, insults, dehumanization<GB-NORMATIVE>...</GB-NORMATIVE>β stereotypes, gender-role policing<GB-SEX>...</GB-SEX>β sexualized degradation tied to gender
Text without gender bias is returned unchanged.
Training
Fine-tuned with Unsloth on annotated + synthetic Thai examples: thunder121x/thai-gender-bias-training-data
Source code and pipeline: github.com/thunder121x/gender-bias-detection
(see services/lora_finetuning/ for the training and inference scripts, including the
exact system prompt required at inference time).
Related
- Sequence classifier: thunder121x/thai-gender-bias-classifier-minilm
Authors
- Nanphat Tongsirisukool β nanphatx@hotmail.com
- Natcha Trairattanasak β pnbookclub@gmail.com
- Downloads last month
- 2