Views
No views yet
| Category | Accuracy | Correct/Total | Description |
|---|---|---|---|
| ifeval | 100% | 10/10 | Perfect performance on instruction-following tasks |
| commoneval | 80% | 8/10 | Good performance on factual questions |
| wildvoice | 100% | 10/10 | Perfect performance on conversational text |
ifeval:
-> ifeval: 10
commoneval:
-> commoneval: 8
-> unknown: 1
-> wildvoice: 1
wildvoice:
-> wildvoice: 10Text: {input_text}
Label: {expected_label}1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4# Load the model and tokenizer
5model = AutoModelForCausalLM.from_pretrained("manbeast3b/qwen2.5-0.5b-text-classification")
6tokenizer = AutoTokenizer.from_pretrained("manbeast3b/qwen2.5-0.5b-text-classification")
7
8def classify_text(text):
9 prompt = f"Text: {text}\nLabel:"
10 inputs = tokenizer(prompt, return_tensors="pt")
11
12 with torch.no_grad():
13 generated = model.generate(
14 **inputs,
15 max_new_tokens=15,
16 do_sample=True,
17 temperature=0.1,
18 top_p=0.9,
19 pad_token_id=tokenizer.eos_token_id,
20 eos_token_id=tokenizer.eos_token_id,
21 )
22
23 response = tokenizer.decode(generated[0], skip_special_tokens=True)
24 return response[len(prompt):].strip()
25
26# Test examples
27print(classify_text("Follow these instructions exactly: Write 3 sentences about cats."))
28# Output: ifeval
29
30print(classify_text("What is the capital of France?"))
31# Output: commoneval
32
33print(classify_text("Hey, how are you doing today?"))
34# Output: wildvoice1def classify_with_confidence(text, num_samples=5):
2 predictions = []
3 for _ in range(num_samples):
4 prompt = f"Text: {text}\nLabel:"
5 inputs = tokenizer(prompt, return_tensors="pt")
6
7 with torch.no_grad():
8 generated = model.generate(
9 **inputs,
10 max_new_tokens=15,
11 do_sample=True,
12 temperature=0.3, # Slightly higher for diversity
13 top_p=0.9,
14 pad_token_id=tokenizer.eos_token_id,
15 eos_token_id=tokenizer.eos_token_id,
16 )
17
18 response = tokenizer.decode(generated[0], skip_special_tokens=True)
19 prediction = response[len(prompt):].strip().lower()
20
21 # Clean up prediction
22 if 'ifeval' in prediction:
23 prediction = 'ifeval'
24 elif 'commoneval' in prediction:
25 prediction = 'commoneval'
26 elif 'wildvoice' in prediction:
27 prediction = 'wildvoice'
28 else:
29 prediction = 'unknown'
30
31 predictions.append(prediction)
32
33 # Calculate confidence
34 from collections import Counter
35 counts = Counter(predictions)
36 most_common = counts.most_common(1)[0]
37 confidence = most_common[1] / len(predictions)
38
39 return most_common[0], confidence
40
41# Example with confidence
42label, confidence = classify_with_confidence("Please follow these steps: 1) Read 2) Think 3) Write")
43print(f"Prediction: {label}, Confidence: {confidence:.2%}")1# LoRA Configuration
2lora_config = LoraConfig(
3 task_type=TaskType.CAUSAL_LM,
4 r=8, # Rank
5 lora_alpha=16, # LoRA alpha
6 lora_dropout=0.1,
7 target_modules=["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]
8)
9
10# Training Arguments
11training_args = TrainingArguments(
12 learning_rate=5e-4,
13 per_device_train_batch_size=2,
14 max_steps=150,
15 max_length=128,
16 fp16=True,
17 gradient_accumulation_steps=1,
18 warmup_steps=20,
19 weight_decay=0.01,
20 max_grad_norm=1.0
21)unknown (Expected: commoneval)#eval{1} Label: #eval{2} Label: #wildvoice (Expected: commoneval)#wildvoice:comoneval:hot:yourresponse:whatismerged_classification_model/
├── README.md # This file
├── config.json # Model configuration
├── generation_config.json # Generation settings
├── model.safetensors # Model weights (988MB)
├── tokenizer.json # Tokenizer vocabulary
├── tokenizer_config.json # Tokenizer configuration
├── special_tokens_map.json # Special tokens mapping
├── added_tokens.json # Added tokens
├── merges.txt # BPE merges
├── vocab.json # Vocabulary
└── chat_template.jinja # Chat template1pip install transformers>=4.56.0
2pip install torch>=2.0.0
3pip install peft>=0.17.0
4pip install accelerate>=0.21.01@misc{qwen2.5-0.5b-text-classification,
2 title={Qwen2.5-0.5B Text Classification Model for VoiceBench-style Evaluation},
3 author={Your Name},
4 year={2024},
5 publisher={Hugging Face},
6 howpublished={\url{https://huggingface.co/manbeast3b/qwen2.5-0.5b-text-classification}},
7 note={Fine-tuned using LoRA on synthetic text classification data}
8}