dartrs
[!WARNING]
wip
Python
pip install -U dartrs
from dartrs.dartrs import DartTokenizer
from dartrs.utils import get_generation_config
from dartrs.v2 import (
compose_prompt,
MixtralModel,
V2Model,
)
import time
import os
MODEL_NAME = "p1atdev/dart-v2-moe-sft"
model = MixtralModel.from_pretrained(MODEL_NAME, dtype="fp16")
tokenizer = DartTokenizer.from_pretrained(MODEL_NAME)
config = get_generation_config(
prompt=compose_prompt(
copyright="vocaloid",
character="hatsune miku",
rating="general",
aspect_ratio="tall",
length="medium",
identity="none",
prompt="1girl, cat ears",
),
tokenizer=tokenizer,
seed=42,
)
start = time.time()
output = model.generate(config)
end = time.time()
print(output)
print(f"Time taken: {end - start:.2f}s")