prometheus-eval/Feedback-Collection
Viewer β’ Updated β’ 100k β’ 955 β’ 120
How to use chargoddard/prometheus-2-llama-3-8b with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="chargoddard/prometheus-2-llama-3-8b")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("chargoddard/prometheus-2-llama-3-8b")
model = AutoModelForCausalLM.from_pretrained("chargoddard/prometheus-2-llama-3-8b")
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]:]))How to use chargoddard/prometheus-2-llama-3-8b with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "chargoddard/prometheus-2-llama-3-8b"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "chargoddard/prometheus-2-llama-3-8b",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/chargoddard/prometheus-2-llama-3-8b
How to use chargoddard/prometheus-2-llama-3-8b with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "chargoddard/prometheus-2-llama-3-8b" \
--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": "chargoddard/prometheus-2-llama-3-8b",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "chargoddard/prometheus-2-llama-3-8b" \
--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": "chargoddard/prometheus-2-llama-3-8b",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use chargoddard/prometheus-2-llama-3-8b with Docker Model Runner:
docker model run hf.co/chargoddard/prometheus-2-llama-3-8b
Replication of prometheus-7b-v2.0 using Llama 3 8B Instruct as a base model.
As in their paper, two different models were trained on their preference and feedback datasets then linearly merged at equal weight.
Training hyperparameters:
Uses Llama 3 Instruct prompt format and the same prompts as prometheus-7b-v2.0. See that readme for info.
@misc{kim2023prometheus,
title={Prometheus: Inducing Fine-grained Evaluation Capability in Language Models},
author={Seungone Kim and Jamin Shin and Yejin Cho and Joel Jang and Shayne Longpre and Hwaran Lee and Sangdoo Yun and Seongjin Shin and Sungdong Kim and James Thorne and Minjoon Seo},
year={2023},
eprint={2310.08491},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@misc{kim2024prometheus,
title={Prometheus 2: An Open Source Language Model Specialized in Evaluating Other Language Models},
author={Seungone Kim and Juyoung Suk and Shayne Longpre and Bill Yuchen Lin and Jamin Shin and Sean Welleck and Graham Neubig and Moontae Lee and Kyungjae Lee and Minjoon Seo},
year={2024},
eprint={2405.01535},
archivePrefix={arXiv},
primaryClass={cs.CL}
}