ChaoticNeutrals/Reddit-NSFW-Writing_Prompts_ShareGPT
Viewer • Updated • 5.94k • 198 • 13
How to use mrcuddle/tiny-darkllama-dpo with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="mrcuddle/tiny-darkllama-dpo")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("mrcuddle/tiny-darkllama-dpo")
model = AutoModelForCausalLM.from_pretrained("mrcuddle/tiny-darkllama-dpo")
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 mrcuddle/tiny-darkllama-dpo with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "mrcuddle/tiny-darkllama-dpo"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "mrcuddle/tiny-darkllama-dpo",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/mrcuddle/tiny-darkllama-dpo
How to use mrcuddle/tiny-darkllama-dpo with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "mrcuddle/tiny-darkllama-dpo" \
--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": "mrcuddle/tiny-darkllama-dpo",
"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 "mrcuddle/tiny-darkllama-dpo" \
--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": "mrcuddle/tiny-darkllama-dpo",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use mrcuddle/tiny-darkllama-dpo with Docker Model Runner:
docker model run hf.co/mrcuddle/tiny-darkllama-dpo
axolotl version: 0.6.0
base_model: mrcuddle/tiny-darkllama
bf16: auto
datasets:
- chat_template: tokenizer_default
field_messages: conversations
message_field_content: value
message_field_role: from
path: Nitral-AI/Reddit-NSFW-Writing_Prompts_ShareGPT
split: train
type: chat_template
debug: null
deepspeed: null
early_stopping_patience: null
eval_sample_packing: true
eval_table_size: null
evals_per_epoch: 1
flash_attention: false
fp16: null
fsdp: null
fsdp_config: null
gradient_accumulation_steps: 2
gradient_checkpointing: true
group_by_length: false
learning_rate: 2e-5
load_in_4bit: false
load_in_8bit: false
logging_steps: 1
lr_scheduler: cosine
max_steps: 25
micro_batch_size: 1
num_epochs: 1
optimizer: paged_adamw_8bit
pad_to_sequence_len: true
resume_from_checkpoint: null
sample_packing: true
saves_per_epoch: 1
sdp_attention: true
sequence_len: 2048
special_tokens:
pad_token: <|end_of_text|>
strict: false
tf32: false
train_on_inputs: false
warmup_steps: 1
weight_decay: 0.0
xformers_attention: null
This model is a fine-tuned version of mrcuddle/tiny-darkllama on the Nitral-AI/Reddit-NSFW-Writing_Prompts_ShareGPT dataset.
More information needed
More information needed
More information needed
The following hyperparameters were used during training: