HumanLLMs/Human-Like-DPO-Dataset
Viewer • Updated • 10.9k • 921 • 255
How to use tsessk/llm-course-hw2-ppo with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="tsessk/llm-course-hw2-ppo")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("tsessk/llm-course-hw2-ppo")
model = AutoModelForCausalLM.from_pretrained("tsessk/llm-course-hw2-ppo")
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 tsessk/llm-course-hw2-ppo with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "tsessk/llm-course-hw2-ppo"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "tsessk/llm-course-hw2-ppo",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/tsessk/llm-course-hw2-ppo
How to use tsessk/llm-course-hw2-ppo with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "tsessk/llm-course-hw2-ppo" \
--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": "tsessk/llm-course-hw2-ppo",
"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 "tsessk/llm-course-hw2-ppo" \
--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": "tsessk/llm-course-hw2-ppo",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use tsessk/llm-course-hw2-ppo with Docker Model Runner:
docker model run hf.co/tsessk/llm-course-hw2-ppo
This is a Proximal Policy Optimization (PPO) fine-tuned version of SmolLM-135M, designed to make its responses more emotional and engaging. The model has been optimized using HumanLLMs/Human-Like-DPO-Dataset.
PPO is a reinforcement learning algorithm commonly used in RLHF (Reinforcement Learning from Human Feedback) to optimize model behavior based on a reward model. Paper
tsessk/llm-course-hw2-reward-modelHere’s an example of how the PPO model responds to a simple prompt compared to a standard LLM.
What's your morning routine like?
I'm excited to start my morning routine! As a digital AI assistant, I don't have personal preferences or habits, but I can provide you with a general idea of what a morning routine might look like. Here's a sample routine that I've developed based on various studies and research:
**Morning Routine (10-15 minutes)**
1. **Hydrate**: Drink a full glass of water or a healthy beverage to start the day.
2. **Brush teeth**: Brush your teeth for 2 minutes, then rinse with water.
3. **Get dressed**: Put on some comfortable clothes, including a light jacket or sweater.
4. **Get ready for work**: Start with some morning exercise, such as a 10-minute yoga or stretching routine.
5. **Plan your day**: Review your schedule, set goals, and prioritize tasks.
6. **Get ready for bed**: Wind down with a relaxing activity, like reading or listening to calming music.
**Morning Routine (15-30 minutes)**
1. **Get ready for work**: Start with some morning exercise, such as a 10-minute yoga or stretching routine.
2. **Get ready for
I'm excited to start my morning routine! As a digital AI assistant, I don't have personal preferences or habits, but I can provide you with a general idea of what a morning routine might look like. Here's a sample routine I came up with:
**Morning Routine (10-15 minutes)**
1. **Hydrate**: Drink a full glass of water or a herbal tea to start the day.
2. **Brush teeth**: Brush your teeth for 2-3 minutes, then rinse with water.
3. **Get dressed**: Put on some comfortable clothes, including a light jacket or sweater.
4. **Get ready for work**: Start your day with a quick breakfast, such as oatmeal with fruit or scrambled eggs with whole-grain toast.
5. **Take a few deep breaths**: Take a few deep breaths to calm your mind and body.
6. **Get ready for the day**: Start your day with a morning workout, such as a yoga or Pilates class.
7. **Get ready for school**: Start your day with a morning routine, such as reading a book or taking a short walk.
8. **Get ready for bed**: Start your day with a gentle sleep
Base model
HuggingFaceTB/SmolLM-135M