p1atdev / dart-v2-base

huggingface.co
Total runs: 33
24-hour runs: 3
7-day runs: 0
30-day runs: 6
Model's Last Updated: 2024年5月12日
text-generation

Introduction of dart-v2-base

Model Details of dart-v2-base

Dart (Danbooru Tags Transformer) v2

This model is a fine-tuned Dart (Danbooru Tags Transformer) v2 base model that generates danbooru tags.

Demo: 🤗 Space with ZERO

Model variants
Name Architecture Param size Type
v2-moe-sft Mixtral 166m SFT
v2-moe-base Mixtral 166m Pretrain
v2-sft Mistral 114m SFT
v2-base Mistral 114m Pretrain
v2-vectors Embedding - Tag Embedding
Usage
Using 🤗Transformers
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
MODEL_NAME = "p1atdev/dart-v2-base"
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
model = AutoModelForCausalLM.from_pretrained(MODEL_NAME, torch_dtype=torch.bfloat16)
prompt = (
    f"<|bos|>"
    f"<copyright>vocaloid</copyright>"
    f"<character>hatsune miku</character>"
    f"<|rating:general|><|aspect_ratio:tall|><|length:long|>"
    f"<general>1girl"
)
inputs = tokenizer(prompt, return_tensors="pt").input_ids
with torch.no_grad():
  outputs = model.generate(
    inputs,
    do_sample=True,
    temperature=1.0,
    top_p=1.0,
    top_k=100,
    max_new_tokens=128,
    num_beams=1,
  )
print(", ".join([tag for tag in tokenizer.batch_decode(outputs[0], skip_special_tokens=True) if tag.strip() != ""]))
Using 📦 dartrs library

This library is very experimental and there will be breaking changes in the future.

📦 dartrs is a 🤗 candle backend inference library for Dart v2 models.

pip install -U dartrs
from dartrs.dartrs import DartTokenizer
from dartrs.utils import get_generation_config
from dartrs.v2 import (
    compose_prompt,
    MistralModel,
    V2Model,
)
import time
import os
MODEL_NAME = "p1atdev/dart-v2-base"
model = MistralModel.from_pretrained(MODEL_NAME)
tokenizer = DartTokenizer.from_pretrained(MODEL_NAME)
config = get_generation_config(
    prompt=compose_prompt(
        copyright="vocaloid",
        character="hatsune miku",
        rating="general", # sfw, general, sensitive, nsfw, questionable, explicit
        aspect_ratio="tall", # ultra_wide, wide, square, tall, ultra_tall
        length="medium", # very_short, short, medium, long, very_long
        prompt="1girl, cat ears",
        do_completion=False
    ),
    tokenizer=tokenizer,
)
start = time.time()
output = model.generate(config)
end = time.time()
print(output)
print(f"Time taken: {end - start:.2f}s")
# cowboy shot, detached sleeves, empty eyes, green eyes, green hair, green necktie, hair in own mouth, hair ornament, letterboxed, light frown, long hair, long sleeves, looking to the side, necktie, parted lips, shirt, sleeveless, sleeveless shirt, twintails, wing collar
# Time taken: 0.26s
Prompt Format
prompt = (
    f"<|bos|>"
    f"<copyright>{copyright_tags_here}</copyright>"
    f"<character>{character_tags_here}</character>"
    f"<|rating:general|><|aspect_ratio:tall|><|length:long|>"
    f"<general>{general_tags_here}"
)
  • Rating tag: <|rating:sfw|> , <|rating:general|> , <|rating:sensitive|> , nsfw , <|rating:questionable|> , <|rating:explicit|>

    • sfw : randomly generates tags in general or sensitive rating categories.
    • general : generates tags in general rating category.
    • sensitive : generates tags in sensitive rating category.
    • nsfw : randomly generates tags in questionable or explicit rating categories.
    • questionable : generates tags in questionable rating category.
    • explicit : generates tags in explicit rating category.
  • Aspect ratio tag: <|aspect_ratio:ultra_wide|> , <|aspect_ratio:wide|> , <|aspect_ratio:square|> , <|aspect_ratio:tall|> , <|aspect_ratio:ultra_tall|>

    • ultra_wide : generates tags suits for extremely wide aspect ratio images. (~2:1)
    • wide : generates tags suits for wide aspect ratio images. (2:1~9:8)
    • square : generates tags suits for square aspect ratio images. (9:8~8:9)
    • tall : generates tags suits for tall aspect ratio images. (8:9~1:2)
    • ultra_tall : generates tags suits for extremely tall aspect ratio images. (1:2~)
  • Length tag: <|length:very_short|> , <|length:short|> , <|length:medium|> , <|length:long|> , <|length:very_long|>

    • very_short : totally generates ~10 number of tags.
    • short : totally generates ~20 number of tags.
    • medium : totally generates ~30 number of tags.
    • long : totally generates ~40 number of tags.
    • very_long : totally generates 40~ number of tags.
Model Details
Model Description
  • Developed by: Plat
  • Model type: Causal language model
  • Language(s) (NLP): Danbooru tags
  • License: Apache-2.0
  • Demo: Available on 🤗 Space
Training Details
Training Data

This model was trained with:

Training Procedure

TODO

Preprocessing [optional]

[More Information Needed]

Training Hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 0.0005
  • train_batch_size: 1024
  • eval_batch_size: 256
  • seed: 42
  • gradient_accumulation_steps: 2
  • total_train_batch_size: 2048
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: cosine
  • lr_scheduler_warmup_steps: 1000
  • num_epochs: 5
Evaluation

Evaluation has not been done yet and it needs to evaluate.

Model Architecture and Objective

The architecture of this model is Mistral . See details in config.json .

Compute Infrastructure

Private server.

Hardware

8x RTX A6000

Software
Related Projects

Runs of p1atdev dart-v2-base on huggingface.co

33
Total runs
3
24-hour runs
2
3-day runs
0
7-day runs
6
30-day runs

More Information About dart-v2-base huggingface.co Model

More dart-v2-base license Visit here:

https://choosealicense.com/licenses/apache-2.0

dart-v2-base huggingface.co

dart-v2-base huggingface.co is an AI model on huggingface.co that provides dart-v2-base's model effect (), which can be used instantly with this p1atdev dart-v2-base model. huggingface.co supports a free trial of the dart-v2-base model, and also provides paid use of the dart-v2-base. Support call dart-v2-base model through api, including Node.js, Python, http.

dart-v2-base huggingface.co Url

https://huggingface.co/p1atdev/dart-v2-base

p1atdev dart-v2-base online free

dart-v2-base huggingface.co is an online trial and call api platform, which integrates dart-v2-base's modeling effects, including api services, and provides a free online trial of dart-v2-base, you can try dart-v2-base online for free by clicking the link below.

p1atdev dart-v2-base online free url in huggingface.co:

https://huggingface.co/p1atdev/dart-v2-base

dart-v2-base install

dart-v2-base is an open source model from GitHub that offers a free installation service, and any user can find dart-v2-base on GitHub to install. At the same time, huggingface.co provides the effect of dart-v2-base install, users can directly use dart-v2-base installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

dart-v2-base install url in huggingface.co:

https://huggingface.co/p1atdev/dart-v2-base

Url of dart-v2-base

dart-v2-base huggingface.co Url

Provider of dart-v2-base huggingface.co

p1atdev
ORGANIZATIONS

Other API from p1atdev

huggingface.co

Total runs: 9.7K
Run Growth: 8.4K
Growth Rate: 87.11%
Updated:2023年2月28日
huggingface.co

Total runs: 1.3K
Run Growth: -2.4K
Growth Rate: -187.53%
Updated:2024年5月12日
huggingface.co

Total runs: 916
Run Growth: -52
Growth Rate: -5.68%
Updated:2024年3月11日
huggingface.co

Total runs: 47
Run Growth: 2
Growth Rate: 4.26%
Updated:2023年6月21日
huggingface.co

Total runs: 35
Run Growth: 4
Growth Rate: 11.43%
Updated:2023年5月10日
huggingface.co

Total runs: 23
Run Growth: -17
Growth Rate: -73.91%
Updated:2024年3月11日
huggingface.co

Total runs: 14
Run Growth: 8
Growth Rate: 57.14%
Updated:2023年5月20日
huggingface.co

Total runs: 7
Run Growth: 6
Growth Rate: 85.71%
Updated:2023年7月6日
huggingface.co

Total runs: 6
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年5月7日
huggingface.co

Total runs: 3
Run Growth: 2
Growth Rate: 66.67%
Updated:2024年6月29日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年5月29日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年5月15日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年3月2日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年2月16日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年3月1日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年7月23日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年3月28日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年7月1日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年4月4日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年4月4日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年3月23日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年1月21日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年2月15日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年1月25日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年7月9日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2025年1月20日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年5月27日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年4月3日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2023年2月15日