Instructions to use mzhaoshuai/zephyr-7b-alpha-conf-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mzhaoshuai/zephyr-7b-alpha-conf-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mzhaoshuai/zephyr-7b-alpha-conf-sft") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mzhaoshuai/zephyr-7b-alpha-conf-sft") model = AutoModelForCausalLM.from_pretrained("mzhaoshuai/zephyr-7b-alpha-conf-sft", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mzhaoshuai/zephyr-7b-alpha-conf-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mzhaoshuai/zephyr-7b-alpha-conf-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mzhaoshuai/zephyr-7b-alpha-conf-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mzhaoshuai/zephyr-7b-alpha-conf-sft
- SGLang
How to use mzhaoshuai/zephyr-7b-alpha-conf-sft 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 "mzhaoshuai/zephyr-7b-alpha-conf-sft" \ --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": "mzhaoshuai/zephyr-7b-alpha-conf-sft", "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 "mzhaoshuai/zephyr-7b-alpha-conf-sft" \ --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": "mzhaoshuai/zephyr-7b-alpha-conf-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mzhaoshuai/zephyr-7b-alpha-conf-sft with Docker Model Runner:
docker model run hf.co/mzhaoshuai/zephyr-7b-alpha-conf-sft
RefAlign: RL with Similarity-based Rewards
GitHub repository: https://github.com/mzhaoshuai/RefAlign
This repository contains the SFT (Supervised Fine-Tuning) model mzhaoshuai/zephyr-7b-alpha-conf-sft, which is an integral part of the RefAlign framework. This model serves as an initial SFT step for Confidence Alignment experiments, trained with shuchangtao/CONQORD_dataset (specifically, conqord_step1_data), as described in the accompanying research.
Abstract
Large language models~(LLMs) are expected to be helpful, harmless, and honest. In different alignment scenarios, such as safety, confidence, and general preference alignment, binary preference data collection and reward modeling are resource-intensive but play a central role in transferring human preferences. In this work, we explore using the similarity between sampled generations and reference answers as a supplementary reward function for alignment. When unary reference answers are available, such similarity-based rewards can circumvent the need for binary preference data and explicit reward modeling. We introduce \textit{RefAlign}, a versatile REINFORCE-style alignment algorithm that does not rely on reward or reference models. RefAlign utilizes language generation evaluation metrics, such as BERTScore, between sampled generations and reference answers as surrogate rewards. Beyond general preference optimization, RefAlign can be naturally extended to diverse scenarios, including safety and confidence alignment, by combining similarity-based rewards with task-specific objectives. Across multiple scenarios, RefAlign achieves performance comparable to prior alignment methods while operating without binary preference data or reward models.
Framework versions
- PEFT 0.11.1
- Transformers 4.40.0
Bibtex
@article{zhao2025learning,
title={Learning from reference answers: Versatile language model alignment without binary human preference data},
author={Zhao, Shuai and Xu, Yunqiu and Zhu, Linchao and Yang, Yi},
journal={arXiv preprint arXiv:2504.09895},
year={2025}
}
- Downloads last month
- 6