Views
No views yet
bitsandbytes (bnb) via the Hugging Face transformers library to significantly reduce VRAM requirements while maintaining high performance.transformers, or use a convenient wrapper package for automatic VRAM management.1import torch
2from transformers import AutoModelForSequenceClassification, AutoTokenizer
3
4model_name = "agentlans/Skywork-Reward-V2-Llama-3.1-8B-8bit"
5
6# Load the quantized model and tokenizer
7model = AutoModelForSequenceClassification.from_pretrained(
8 model_name,
9 device_map="auto",
10 num_labels=1,
11)
12tokenizer = AutoTokenizer.from_pretrained(model_name)
13
14# You can now follow the standard evaluation pipeline featured on the official Skywork model page.
15skywork-reward-model wrapper.1pip install git+https://github.com/agentlans/skywork-reward-model.git
21from skywork_reward_model import SkyworkRewardModel
2
3# Define your prompt and candidate responses
4prompt = "Explain gravity in one sentence."
5responses = [
6 "Gravity is the force by which a planet or other body draws objects toward its center.",
7 "Gravity is what makes things float away into deep space."
8]
9
10# Path to this quantized repository
11model_path = "agentlans/Skywork-Reward-V2-Llama-3.1-8B-8bit"
12
13# Evaluate with automatic VRAM cleanup context manager
14with SkyworkRewardModel(model_path) as rm:
15 scores = rm.evaluate(prompt, responses)
16
17# Print results (scalars representing the log reward of each response)
18for response, score in zip(responses, scores):
19 print(f"[{score:+.4f}] {response}")
20