isek-ai/danbooru-tags-2016-2023
Viewer • Updated • 5.79M • 581 • 7
How to use isek-ai/SDPrompt-RetNet-v2-beta with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="isek-ai/SDPrompt-RetNet-v2-beta", trust_remote_code=True) # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("isek-ai/SDPrompt-RetNet-v2-beta", trust_remote_code=True, dtype="auto")How to use isek-ai/SDPrompt-RetNet-v2-beta with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "isek-ai/SDPrompt-RetNet-v2-beta"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "isek-ai/SDPrompt-RetNet-v2-beta",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/isek-ai/SDPrompt-RetNet-v2-beta
How to use isek-ai/SDPrompt-RetNet-v2-beta with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "isek-ai/SDPrompt-RetNet-v2-beta" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "isek-ai/SDPrompt-RetNet-v2-beta",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "isek-ai/SDPrompt-RetNet-v2-beta" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "isek-ai/SDPrompt-RetNet-v2-beta",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use isek-ai/SDPrompt-RetNet-v2-beta with Docker Model Runner:
docker model run hf.co/isek-ai/SDPrompt-RetNet-v2-beta
This model is a pretrained RetNet model trained from scratch using https://github.com/syncdoth/RetNet.
It achieves the following results on the evaluation set:
pip install transformers safetensors
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
MODEL_NAME = "isek-ai/SDPrompt-RetNet-v2-beta"
DEVICE = "cuda"
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
model= AutoModelForCausalLM.from_pretrained(
MODEL_NAME,
torch_dtype=torch.float16, # or torch.bfloat16
trust_remote_code=True,
).to(DEVICE)
model.eval()
streamer = TextStreamer(tokenizer)
prompt = "1girl"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
_ = model.generate(
inputs["input_ids"],
max_new_tokens=256,
do_sample=True,
top_p=0.9,
top_k=20,
temperature=0.9,
streamer=streamer,
)
# 1girl, :<, bag, black hair, blurry, bokeh, cloud, depth of field, from side, long sleeves, night, outdoors, pleated skirt, power lines, purple eyes, road, scenery, shoes, shoulder bag,gasm, sidelocks, sign, skirt,let's drawsaurus, skylight smile, sneakers, standing, star (sky), sweater, town, traffic cone, utility pole, vending machine, wide-eyed, window, wooden box, yellow skirt,ization, zettai ryouiki, zoom layer, white footwear, zipper, zipper pull tab, zipperland sheet, zombie pose, ladder, leaning back, leg up, looking to the side,let, miniskirt, motion blur, musical note, open mouth, part
This model is trained with only Danbooru tags to generate prompts for image generation models.
TODO
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.975 | 0.07 | 500 | 1.0005 |
| 0.7549 | 0.13 | 1000 | 0.7604 |
| 0.6923 | 0.2 | 1500 | 0.7090 |
| 0.6753 | 0.26 | 2000 | 0.6778 |
| 0.6591 | 0.33 | 2500 | 0.6568 |
| 0.6337 | 0.39 | 3000 | 0.6429 |
| 0.6288 | 0.46 | 3500 | 0.6319 |
| 0.624 | 0.53 | 4000 | 0.6218 |
| 0.62 | 0.59 | 4500 | 0.6172 |
| 0.603 | 0.66 | 5000 | 0.6090 |
| 0.5931 | 0.72 | 5500 | 0.6032 |
| 0.5957 | 0.79 | 6000 | 0.5986 |
| 0.5972 | 0.85 | 6500 | 0.5948 |
| 0.5928 | 0.92 | 7000 | 0.5926 |
| 0.5904 | 0.98 | 7500 | 0.5923 |
docker model run hf.co/isek-ai/SDPrompt-RetNet-v2-beta