p1atdev commited on
Commit
75e2f8d
1 Parent(s): fba69ac

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +42 -5
README.md CHANGED
@@ -14,17 +14,54 @@ This model is a pretrained RetNet model trained from scratch using https://githu
14
  It achieves the following results on the evaluation set:
15
  - Loss: 0.5923
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  ## Model description
18
 
19
- More information needed
20
 
21
- ## Intended uses & limitations
22
 
23
- More information needed
24
 
25
- ## Training and evaluation data
26
 
27
- More information needed
28
 
29
  ## Training procedure
30
 
 
14
  It achieves the following results on the evaluation set:
15
  - Loss: 0.5923
16
 
17
+ ## Usage
18
+
19
+ ```bash
20
+ pip install transformers safetensors
21
+ ```
22
+
23
+ ```py
24
+ import torch
25
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
26
+
27
+ MODEL_NAME = "isek-ai/SDPrompt-RetNet-v2"
28
+ DEVICE = "cuda"
29
+
30
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
31
+ model= AutoModelForCausalLM.from_pretrained(
32
+ MODEL_NAME,
33
+ torch_dtype=torch.float16, # or torch.bfloat16
34
+ trust_remote_code=True,
35
+ ).to(DEVICE)
36
+ model.eval()
37
+ streamer = TextStreamer(tokenizer)
38
+
39
+ prompt = "1girl"
40
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
41
+ _ = model.generate(
42
+ inputs["input_ids"],
43
+ max_new_tokens=256,
44
+ do_sample=True,
45
+ top_p=0.9,
46
+ top_k=20,
47
+ temperature=0.9,
48
+ streamer=streamer,
49
+ )
50
+ # 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
51
+ ```
52
+
53
+
54
  ## Model description
55
 
56
+ This model is trained with *:only Danbooru tags** to generate prompts for image generation models.
57
 
58
+ ## Training data
59
 
60
+ - [isek-ai/danbooru-tags-2016-2023](https://huggingface.co/datasets/isek-ai/danbooru-tags-2016-2023)
61
 
62
+ ### Dataset filtering
63
 
64
+ TODO
65
 
66
  ## Training procedure
67