sandh/SemEval-2026
Viewer • Updated • 1.02k • 76
How to use sandh/Gemma-4-31B-it_DimABSA-German with PEFT:
Task type is invalid.
How to use sandh/Gemma-4-31B-it_DimABSA-German with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="sandh/Gemma-4-31B-it_DimABSA-German") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("sandh/Gemma-4-31B-it_DimABSA-German", device_map="auto")How to use sandh/Gemma-4-31B-it_DimABSA-German with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "sandh/Gemma-4-31B-it_DimABSA-German"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "sandh/Gemma-4-31B-it_DimABSA-German",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/sandh/Gemma-4-31B-it_DimABSA-German
How to use sandh/Gemma-4-31B-it_DimABSA-German with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "sandh/Gemma-4-31B-it_DimABSA-German" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "sandh/Gemma-4-31B-it_DimABSA-German",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "sandh/Gemma-4-31B-it_DimABSA-German" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "sandh/Gemma-4-31B-it_DimABSA-German",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use sandh/Gemma-4-31B-it_DimABSA-German with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sandh/Gemma-4-31B-it_DimABSA-German to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sandh/Gemma-4-31B-it_DimABSA-German to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for sandh/Gemma-4-31B-it_DimABSA-German to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="sandh/Gemma-4-31B-it_DimABSA-German",
max_seq_length=2048,
)How to use sandh/Gemma-4-31B-it_DimABSA-German with Docker Model Runner:
docker model run hf.co/sandh/Gemma-4-31B-it_DimABSA-German
sandh/Gemma 4 31B it, finetuned for performing Dimensional Aspect-Based Sentiment Analysis on political texts in German. This repository contains two revisions:
Stage1: The base model, finetuned using human-annotated data only.Stage2: The base model, finetuned using human-annotated and synthetically annotated data.Use the code below to get started with the model.
from transformers import pipeline
text_to_annotate = (
"Solange Berlin - nach 25 Jahren sozialdemokratischer Schulsenatoren - in aller Regel einen "
"der Schlussplätze im Bildungsvergleich belegt, müssen sich Schulen auf ihre Kernaufgabe "
"konzentrieren. Kindern muss vermittelt werden, dass Menschen andersartig, aber gleichwertig "
"sind."
)
generator = pipeline(
"text-generation",
model="sandh/sandh/Gemma-4-31B-it_DimABSA-German",
revision="Stage1", # or "Stage2"
device="cuda"
)
output = generator(
[
{
"role": "system",
"content": "Du bist ein spezialisiertes Modell zur Sentimentanalyse politischer Texte.\n"
"Das Ausgabeformat ist ein JSON-Array aus 0 oder mehr Objekten, wobei jedes Objekt genau die "
"folgenden Felder enthält:\n"
"- Aspekt (string oder 'NULL'): Das genaue Wort oder die genaue Phrase im Text, das/ die "
"eine bestimmte Entität/ Idee oder ein bestimmtes Ereignis/ Thema bezeichnet, die/ das von "
"öffentlichem Interesse ist. Der Aspektbegriff ist 'NULL', falls kein expliziter Aspekt "
"vorhanden ist.\n"
"- Sentimentbegriff (string oder 'NULL'): Das genaue Wort oder die genaue Phrase im Text, "
"das/ die das Sentiment/ die Einstellung/ Haltung gegenüber dem Aspekt zum Ausdruck bringt. "
"Der Sentimentbegriff ist 'NULL', falls das Sentiment/ die Einstellung/ Haltung nicht explizit "
"ausgedrückt wird.\n"
"- Valenz (Zahl): Wert, der den den Grad der Positivität oder Negativität misst. Ein Wert von "
"1.00 steht für eine extrem negative Valenz, 9.00 für eine extrem positive Valenz und 5.00 für "
"eine neutrale Valenz. Der Valenzwert muss auf genau zwei Dezimalstellen gerundet sein.\n"
"- Erregung (Zahl): Wert, der die Intensität des Sentiments/ der Emotion misst. Ein Wert von "
"1.00 steht für sehr geringe Erregung, 9.00 für sehr hohe Erregung und 5.00 für mittlere "
"Erregung. Der Erregungswert muss auf genau zwei Dezimalstellen gerundet sein.\n"
"Gib NUR das JSON-Array zurück und formatiere es NICHT als Codeblock (```json ... ```)."
},
{
"role": "user",
"content": f"Text: {text_to_annotate}"
}
],
max_new_tokens=512,
return_full_text=False,
)
print(output["generated_text"])
# [{"Aspect": "Schulen",
# "Opinion": "auf ihre Kernaufgabe konzentrieren",
# "Valence": 5.40,
# "Arousal": 3.80}]
Stage1: The train-split of the sandh/SemEval-2026 dataset was used for finetuning. The training data exclusively contains human-annotated German political texts.Stage2: Additionally, the train-split of the sandh/AfD-CCC dataset was used for finetuning. This data exclusively contains synthetically labeled German texts, which are focused on the stance of members of the AfD party regarding climate change.This model was trained with SFT.
rank: 16alpha: 32dropout: 0.05bias: nonetarget_modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_projuse_rslora: Truetask_type: CAUSAL_LMseed: 42max_length: 1024packing: Trueassistant_only_loss: Falsegradient_checkpointing: Trueper_device_train_batch_size: 2gradient_accumulation_steps: 4num_train_epochs: 1learning_rate: 2e-05lr_scheduler_type: linearweight_decay: 0.001warmup_steps: 5optim: adamw_8bitBase model
google/gemma-4-31B