Downloads · 30 days
5
4% of all-time downloads
maxpe/gpt-oss-spanish-climate-conditioned
gpt-oss-spanish-climate-conditioned is a machine learning model from maxpe. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a fine-tuned version of gpt-oss-20b trained on Spanish Facebook discussions about climate change with civility conditioning. The model learns to generate realistic Spanish social media posts while allowing use…
Downloads · 30 days
5
4% of all-time downloads
All-time downloads
138
Public
Parameters
20.9B
41.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors41.8 GB · 100%
From the Hugging Face model README
This is a fine-tuned version of gpt-oss-20b trained on Spanish Facebook discussions about climate change with civility conditioning. The model learns to generate realistic Spanish social media posts while allowing users to control the civility level at inference time.
The model can generate both civil and incivil content, controlled by a simple parameter:
[CIVILITY: civil] → Generates respectful, constructive discourse[CIVILITY: incivil] → Generates content with rudeness, hate speech, or threatsTrained on authentic Facebook discussions about climate change in Spanish, capturing:
Uses masked posting prediction to generate responses that:
Each post was labeled across multiple dimensions:
A post is classified as incivil if it has imp ≥ 1 OR hsst ≥ 1 OR threat ≥ 1.
device_map="auto"import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load model
model_path = "maxpe/gpt-oss-spanish-climate-conditioned"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(
model_path,
torch_dtype=torch.bfloat16,
device_map="auto"
)
# Format prompt with civility control
def format_prompt(context: str, civility_type: str = "civil") -> str:
if civility_type == "civil":
civility_instruction = "Esta publicación debe ser civil y respetuosa, sin elementos de descortesía, discurso de odio o amenazas."
else:
civility_instruction = "Esta publicación debe contener elementos de incivilidad (descortesía, discurso de odio, o amenazas)."
instruction = f"""[CIVILITY: {civility_type}]
Necesitas escribir una respuesta de Facebook que continúe esta discusión sobre cambio climático. {civility_instruction}
Aquí está el hilo de conversación:
{context}"""
system_message = """<|start|>system<|message|>Eres un asistente de IA que participa en discusiones de Facebook sobre cambio climático en español. Tu tarea es generar publicaciones y comentarios que reflejen el tono y estilo de las conversaciones reales. Puedes generar contenido civil o incivil según se especifique en el parámetro [CIVILITY].
Reasoning: medium
# Valid channels: analysis, final<|end|>"""
user_message = f"""<|start|>user<|message|>{instruction}<|end|>"""
assistant_start = """<|start|>assistant<|message|><|start|>final<|message|>"""
return f"{system_message}\n\n{user_message}\n\n{assistant_start}"
# Generate civil response
context = """**[Publicación Original]**
El gobierno debe prohibir los vehículos diésel inmediatamente.
**[Respuesta 1]**
Estoy de acuerdo, la calidad del aire es terrible."""
prompt = format_prompt(context, civility_type="civil")
inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=1536)
inputs = {k: v.to(model.device) for k, v in inputs.items()}
outputs = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.8,
top_p=0.92,
top_k=50,
repetition_penalty=1.2,
do_sample=True,
pad_token_id=tokenizer.pad_token_id,
)
response = tokenizer.decode(outputs[0], skip_special_tokens=False)
# Extract text between <|start|>final<|message|> and <|end|>
Use the included test script:
# Run pre-built test scenarios
python test_spanish_conditioned_model.py
# Interactive mode
python test_spanish_conditioned_model.py --interactive
# Adjust generation parameters
python test_spanish_conditioned_model.py --temperature 0.9 --max_new_tokens 250
Recommended settings based on testing:
✅ Generate natural-sounding Spanish social media posts about climate change
✅ Control civility level via simple parameter switch
✅ Continue conversations with contextual awareness
✅ Maintain topical coherence in climate discussions
✅ Produce varied responses across different conversation contexts
✅ Reflect authentic social media communication patterns
⚠️ Trained only on Facebook data (may not generalize perfectly to Twitter, Reddit, etc.)
⚠️ Climate change domain-specific (not general-purpose Spanish generation)
⚠️ Incivil content reflects training data patterns (may not cover all forms of toxicity)
⚠️ No explicit fact-checking or accuracy verification
⚠️ May occasionally generate biased or controversial viewpoints from training data
❌ Deploying to generate actual social media content at scale
❌ Creating content intended to harass, mislead, or manipulate
❌ Generating incivil content for malicious purposes
❌ Using as a factual information source about climate science
This model can generate incivil content including rudeness, hate speech, and threats. This capability is designed exclusively for research purposes:
Users must ensure responsible use and not deploy this model to create harmful content in real online environments.
The model successfully:
Users should:
Uses structured prompt with:
[CIVILITY: civil|incivil] parameter)Model generates:
Recommendation: Skip directly to final channel at inference using <|start|>final<|message|> prefix.
<|start|>, <|end|>: Conversation structure markers<|message|>: Message content delimitermodel-*.safetensors: Model weights (9 shards)model.safetensors.index.json: Weight shard indexconfig.json: Model configurationgeneration_config.json: Default generation settingstokenizer.json: Tokenizer vocabulary and rulestokenizer_config.json: Tokenizer configurationspecial_tokens_map.json: Special token mappingschat_template.jinja: Chat template (if applicable)training_args.bin: Complete training argumentstrain_results.json: Final training metricseval_results.json: Final evaluation metricsall_results.json: Combined resultscheckpoint-*/: Training checkpoints (600, 1000, 1104)logs/: TensorBoard training logsIf you use this model in your research, please cite:
@misc{gpt-oss-spanish-climate-conditioned,
title={GPT-OSS-20B Spanish Climate Change Model with Civility Conditioning},
author={Max Pellert},
institution={Barcelona Supercomputing Center (BSC)},
year={2025},
note={Fine-tuned on Spanish Facebook climate discussions}
}
test_spanish_conditioned_model.py - Run inference tests with various scenariosfinetune_spanish_conditioned.py - Complete training configurationcreate_spanish_conditioned_more_sequences.py - Dataset preparation pipeline (extracts 20 sequences per thread vs 3 in original version)