File size: 30,807 Bytes
806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 9d0cfc4 806ca56 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Processing file: E:\\training_dir\\realistic-sample-prompts.txt\n",
"</pre>\n"
],
"text/plain": [
"Processing file: E:\\training_dir\\realistic-sample-prompts.txt\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">βββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββββ\n",
"β<span style=\"font-weight: bold\"> Prompt Type </span>β<span style=\"font-weight: bold\"> Prompt </span>β<span style=\"font-weight: bold\"> Token Count </span>β\n",
"β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©\n",
"β <span style=\"color: #008000; text-decoration-color: #008000\">Positive</span> β score_9, score_8_up, score_7_up, score_6_up, rating_explicit, source_furry, solo, β 60 β\n",
"β β female anthro kindred, mask, presenting, white pillow, bedroom, looking at viewer, β β\n",
"β β detailed background, amazing_background, scenery porn, realistic, photo β β\n",
"β <span style=\"color: #800000; text-decoration-color: #800000\">Negative</span> β low quality, worst quality, blurred background, blurry, simple background β 13 β\n",
"βββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ\n",
"</pre>\n"
],
"text/plain": [
"βββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββββ\n",
"β\u001b[1m \u001b[0m\u001b[1mPrompt Type\u001b[0m\u001b[1m \u001b[0mβ\u001b[1m \u001b[0m\u001b[1mPrompt \u001b[0m\u001b[1m \u001b[0mβ\u001b[1m \u001b[0m\u001b[1mToken Count\u001b[0m\u001b[1m \u001b[0mβ\n",
"β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©\n",
"β \u001b[32mPositive\u001b[0m β score_9, score_8_up, score_7_up, score_6_up, rating_explicit, source_furry, solo, β 60 β\n",
"β β female anthro kindred, mask, presenting, white pillow, bedroom, looking at viewer, β β\n",
"β β detailed background, amazing_background, scenery porn, realistic, photo β β\n",
"β \u001b[31mNegative\u001b[0m β low quality, worst quality, blurred background, blurry, simple background β 13 β\n",
"βββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">βββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββββ\n",
"β<span style=\"font-weight: bold\"> Prompt Type </span>β<span style=\"font-weight: bold\"> Prompt </span>β<span style=\"font-weight: bold\"> Token Count </span>β\n",
"β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©\n",
"β <span style=\"color: #008000; text-decoration-color: #008000\">Positive</span> β score_9, score_8_up, score_7_up, score_6_up, rating_explicit, source_furry, solo, β 70 β\n",
"β β anthro female wolf, sexy pose, standing, gray fur, brown fur, canine pussy, black β β\n",
"β β nose, blue eyes, pink areola, pink nipples, detailed background, β β\n",
"β β amazing_background, realistic, photo β β\n",
"β <span style=\"color: #800000; text-decoration-color: #800000\">Negative</span> β low quality, worst quality, blurred background, blurry, simple background β 13 β\n",
"βββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ\n",
"</pre>\n"
],
"text/plain": [
"βββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββββ\n",
"β\u001b[1m \u001b[0m\u001b[1mPrompt Type\u001b[0m\u001b[1m \u001b[0mβ\u001b[1m \u001b[0m\u001b[1mPrompt \u001b[0m\u001b[1m \u001b[0mβ\u001b[1m \u001b[0m\u001b[1mToken Count\u001b[0m\u001b[1m \u001b[0mβ\n",
"β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©\n",
"β \u001b[32mPositive\u001b[0m β score_9, score_8_up, score_7_up, score_6_up, rating_explicit, source_furry, solo, β 70 β\n",
"β β anthro female wolf, sexy pose, standing, gray fur, brown fur, canine pussy, black β β\n",
"β β nose, blue eyes, pink areola, pink nipples, detailed background, β β\n",
"β β amazing_background, realistic, photo β β\n",
"β \u001b[31mNegative\u001b[0m β low quality, worst quality, blurred background, blurry, simple background β 13 β\n",
"βββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">βββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββββ\n",
"β<span style=\"font-weight: bold\"> Prompt Type </span>β<span style=\"font-weight: bold\"> Prompt </span>β<span style=\"font-weight: bold\"> Token Count </span>β\n",
"β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©\n",
"β <span style=\"color: #008000; text-decoration-color: #008000\">Positive</span> β score_9, score_8_up, score_7_up, score_6_up, rating_explicit, source_furry, solo, β 73 β\n",
"β β anthro male fox, glowing yellow eyes, night, crescent moon, gold bracers and β β\n",
"β β necklace, loincloth, canine genitalia, knot, amazing_background, scenery porn, β β\n",
"β β white marble ruins, realistic, photo β β\n",
"β <span style=\"color: #800000; text-decoration-color: #800000\">Negative</span> β low quality, worst quality, blurred background, blurry, simple background β 13 β\n",
"βββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ\n",
"</pre>\n"
],
"text/plain": [
"βββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββββ\n",
"β\u001b[1m \u001b[0m\u001b[1mPrompt Type\u001b[0m\u001b[1m \u001b[0mβ\u001b[1m \u001b[0m\u001b[1mPrompt \u001b[0m\u001b[1m \u001b[0mβ\u001b[1m \u001b[0m\u001b[1mToken Count\u001b[0m\u001b[1m \u001b[0mβ\n",
"β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©\n",
"β \u001b[32mPositive\u001b[0m β score_9, score_8_up, score_7_up, score_6_up, rating_explicit, source_furry, solo, β 73 β\n",
"β β anthro male fox, glowing yellow eyes, night, crescent moon, gold bracers and β β\n",
"β β necklace, loincloth, canine genitalia, knot, amazing_background, scenery porn, β β\n",
"β β white marble ruins, realistic, photo β β\n",
"β \u001b[31mNegative\u001b[0m β low quality, worst quality, blurred background, blurry, simple background β 13 β\n",
"βββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">βββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββββ\n",
"β<span style=\"font-weight: bold\"> Prompt Type </span>β<span style=\"font-weight: bold\"> Prompt </span>β<span style=\"font-weight: bold\"> Token Count </span>β\n",
"β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©\n",
"β <span style=\"color: #008000; text-decoration-color: #008000\">Positive</span> β score_9, score_8_up, score_7_up, score_6_up, rating_safe, source_furry, solo, β 74 β\n",
"β β full-length portrait, anthro female red panda, detailed background, β β\n",
"β β amazing_background, pussy, scenery porn, photo, realistic, looking at viewer, on β β\n",
"β β back, sexy pose, humanoid hands, claws, pink areola, pink nipples β β\n",
"β <span style=\"color: #800000; text-decoration-color: #800000\">Negative</span> β low quality, worst quality, blurred background, blurry, simple background β 13 β\n",
"βββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ\n",
"</pre>\n"
],
"text/plain": [
"βββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββββ\n",
"β\u001b[1m \u001b[0m\u001b[1mPrompt Type\u001b[0m\u001b[1m \u001b[0mβ\u001b[1m \u001b[0m\u001b[1mPrompt \u001b[0m\u001b[1m \u001b[0mβ\u001b[1m \u001b[0m\u001b[1mToken Count\u001b[0m\u001b[1m \u001b[0mβ\n",
"β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©\n",
"β \u001b[32mPositive\u001b[0m β score_9, score_8_up, score_7_up, score_6_up, rating_safe, source_furry, solo, β 74 β\n",
"β β full-length portrait, anthro female red panda, detailed background, β β\n",
"β β amazing_background, pussy, scenery porn, photo, realistic, looking at viewer, on β β\n",
"β β back, sexy pose, humanoid hands, claws, pink areola, pink nipples β β\n",
"β \u001b[31mNegative\u001b[0m β low quality, worst quality, blurred background, blurry, simple background β 13 β\n",
"βββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">βββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββββ\n",
"β<span style=\"font-weight: bold\"> Prompt Type </span>β<span style=\"font-weight: bold\"> Prompt </span>β<span style=\"font-weight: bold\"> Token Count </span>β\n",
"β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©\n",
"β <span style=\"color: #008000; text-decoration-color: #008000\">Positive</span> β score_9, score_8_up, score_7_up, rating_explicit, source_furry, solo, full-length β 69 β\n",
"β β portrait, anthro female snow leopard, pussy, pink nipples, pink areola, detailed β β\n",
"β β background, amazing_background, scenery porn, snowy mountain peak, on back, sexy β β\n",
"β β pose, looking at viewer, realistic, photo β β\n",
"β <span style=\"color: #800000; text-decoration-color: #800000\">Negative</span> β low quality, worst quality, blurred background, blurry, simple background β 13 β\n",
"βββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ\n",
"</pre>\n"
],
"text/plain": [
"βββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββββ\n",
"β\u001b[1m \u001b[0m\u001b[1mPrompt Type\u001b[0m\u001b[1m \u001b[0mβ\u001b[1m \u001b[0m\u001b[1mPrompt \u001b[0m\u001b[1m \u001b[0mβ\u001b[1m \u001b[0m\u001b[1mToken Count\u001b[0m\u001b[1m \u001b[0mβ\n",
"β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©\n",
"β \u001b[32mPositive\u001b[0m β score_9, score_8_up, score_7_up, rating_explicit, source_furry, solo, full-length β 69 β\n",
"β β portrait, anthro female snow leopard, pussy, pink nipples, pink areola, detailed β β\n",
"β β background, amazing_background, scenery porn, snowy mountain peak, on back, sexy β β\n",
"β β pose, looking at viewer, realistic, photo β β\n",
"β \u001b[31mNegative\u001b[0m β low quality, worst quality, blurred background, blurry, simple background β 13 β\n",
"βββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">βββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββββ\n",
"β<span style=\"font-weight: bold\"> Prompt Type </span>β<span style=\"font-weight: bold\"> Prompt </span>β<span style=\"font-weight: bold\"> Token Count </span>β\n",
"β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©\n",
"β <span style=\"color: #008000; text-decoration-color: #008000\">Positive</span> β score_9, score_8_up, score_7_up, score_6_up, rating_safe, source_furry, portrait, β 71 β\n",
"β β an anthro male wolf, black nose, (white fur:1.2), monotone fur, green eyes, purple β β\n",
"β β wizard hat, purple wizard robe, detailed background, amazing_background, forest, β β\n",
"β β realistic, photo β β\n",
"β <span style=\"color: #800000; text-decoration-color: #800000\">Negative</span> β low quality, worst quality, blurred background, blurry, simple background β 13 β\n",
"βββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ\n",
"</pre>\n"
],
"text/plain": [
"βββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββββ\n",
"β\u001b[1m \u001b[0m\u001b[1mPrompt Type\u001b[0m\u001b[1m \u001b[0mβ\u001b[1m \u001b[0m\u001b[1mPrompt \u001b[0m\u001b[1m \u001b[0mβ\u001b[1m \u001b[0m\u001b[1mToken Count\u001b[0m\u001b[1m \u001b[0mβ\n",
"β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©\n",
"β \u001b[32mPositive\u001b[0m β score_9, score_8_up, score_7_up, score_6_up, rating_safe, source_furry, portrait, β 71 β\n",
"β β an anthro male wolf, black nose, (white fur:1.2), monotone fur, green eyes, purple β β\n",
"β β wizard hat, purple wizard robe, detailed background, amazing_background, forest, β β\n",
"β β realistic, photo β β\n",
"β \u001b[31mNegative\u001b[0m β low quality, worst quality, blurred background, blurry, simple background β 13 β\n",
"βββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">Total number of prompts in realistic-sample-prompts.txt: </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">6</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[1mTotal number of prompts in realistic-sample-prompts.txt: \u001b[0m\u001b[1;36m6\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import os\n",
"import tiktoken\n",
"from rich.console import Console\n",
"from rich.table import Table\n",
"\n",
"\n",
"def count_tokens(text):\n",
" enc = tiktoken.get_encoding(\"cl100k_base\")\n",
" tokens = enc.encode(text)\n",
" return len(tokens)\n",
"\n",
"count_tokens(\"canine genitalia, knot\")\n",
"\n",
"console = Console()\n",
"\n",
"for file in os.listdir(\"E:\\\\training_dir\"):\n",
" if file.endswith(\"-sample-prompts.txt\"):\n",
" file_path = os.path.join(\"E:\\\\training_dir\", file)\n",
" console.print(f\"Processing file: {file_path}\")\n",
"\n",
" prompt_count = 0\n",
" with open(file_path, \"r\") as f:\n",
" lines = f.readlines()\n",
"\n",
" for line in lines:\n",
" if line.startswith(\"#\"):\n",
" continue\n",
" parts = line.split(\"--n\")\n",
" positive_prompt = parts[0].strip()\n",
" negative_prompt = parts[1].strip().split(\" --\")[0]\n",
"\n",
" positive_token_count = count_tokens(positive_prompt)\n",
" negative_token_count = count_tokens(negative_prompt)\n",
"\n",
" table = Table()\n",
" table.add_column(\"Prompt Type\", justify=\"left\")\n",
" table.add_column(\"Prompt\", justify=\"left\")\n",
" table.add_column(\"Token Count\", justify=\"right\")\n",
" table.add_row(\"[green]Positive[/green]\", positive_prompt, str(positive_token_count))\n",
" table.add_row(\"[red]Negative[/red]\", negative_prompt, str(negative_token_count))\n",
" console.print(table)\n",
"\n",
" if positive_token_count > 77:\n",
" console.print(\n",
" \"[bold red]Warning: Positive prompt token count exceeds 75.[/bold red]\"\n",
" )\n",
" prompt_count += 1\n",
"\n",
" console.print(f\"[bold]Total number of prompts in {file}: {prompt_count}[/bold]\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
|