Datasets:
Add adult and fantasy/SF extension taxonomy, plans and progress (30/2500)
Browse files- EXTENSIONS.md +1 -1
- README.md +8 -1
- metadata/extension/combined-allocation.json +1 -1
- metadata/extension/inference-records.jsonl +0 -0
- metadata/extension/performance.json +3 -3
- metadata/extension/progress.json +12 -8
- metadata/extension/provenance.json +2 -2
- metadata/extension/quality-gate-passed.json +48 -0
- metadata/extension/quality-review.json +123 -0
- metadata/extension/schedule.json +3 -5
- metadata/extension/shards.json +156 -1
- metadata/minor-safety/public-stream-filter.json +1 -1
- tools/character_extension.py +19 -1
- tools/supplement_card.py +120 -0
- tools/validate_character_release.py +7 -3
- tools/webdataset_card_schema.py +13 -0
EXTENSIONS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# Additional adults and fantasy / science-fiction characters
|
| 2 |
|
| 3 |
-
**Extension snapshot:
|
| 4 |
|
| 5 |
The extension runs automatically after the original 500-person, 5,000-image collection is fully decoded, verified against remote shard checksums and published. It adds 240 adult identities with all ten emotions and 100 special identities with one neutral default portrait each. The combined target is **740 human identities × 10 expressions + 100 specials = 7,500 images and 840 identity IDs**.
|
| 6 |
|
|
|
|
| 1 |
# Additional adults and fantasy / science-fiction characters
|
| 2 |
|
| 3 |
+
**Extension snapshot: 30/2,500 images uploaded; 118 generated.** Remaining counts below are the planned allocation.
|
| 4 |
|
| 5 |
The extension runs automatically after the original 500-person, 5,000-image collection is fully decoded, verified against remote shard checksums and published. It adds 240 adult identities with all ten emotions and 100 special identities with one neutral default portrait each. The combined target is **740 human identities × 10 expressions + 100 specials = 7,500 images and 840 identity IDs**.
|
| 6 |
|
README.md
CHANGED
|
@@ -22,11 +22,16 @@ configs:
|
|
| 22 |
- split: train
|
| 23 |
path:
|
| 24 |
- data/*.tar
|
|
|
|
| 25 |
- job-data/*.tar
|
| 26 |
- config_name: base
|
| 27 |
data_files:
|
| 28 |
- split: train
|
| 29 |
path: data/*.tar
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
- config_name: jobs
|
| 31 |
data_files:
|
| 32 |
- split: train
|
|
@@ -314,6 +319,8 @@ dataset_info:
|
|
| 314 |
dtype: string
|
| 315 |
- config_name: base
|
| 316 |
features: *id001
|
|
|
|
|
|
|
| 317 |
- config_name: jobs
|
| 318 |
features: *id001
|
| 319 |
---
|
|
@@ -326,7 +333,7 @@ The [teen/child detector recheck](SAFETY_RECHECK.md) reports actual image checks
|
|
| 326 |
|
| 327 |
# Vivarium warm-painted greenscreen people and special characters
|
| 328 |
|
| 329 |
-
**Combined uploaded snapshot: 5,
|
| 330 |
|
| 331 |
See the detailed [extension allocation and 25-class special taxonomy](EXTENSIONS.md), including all 100 variants, exact prompt plans, CSVs, inference examples and measured progress. The base model is [FLUX.2-klein-base-9B](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B); the [rank-64 character LoRA](https://huggingface.co/laion/FLUX.2-klein-base-9B-vivarium-loras) is linked with examples and inference instructions. Native generation uses **50 steps, real CFG 4 and BF16**.
|
| 332 |
|
|
|
|
| 22 |
- split: train
|
| 23 |
path:
|
| 24 |
- data/*.tar
|
| 25 |
+
- extension-data/humans-*.tar
|
| 26 |
- job-data/*.tar
|
| 27 |
- config_name: base
|
| 28 |
data_files:
|
| 29 |
- split: train
|
| 30 |
path: data/*.tar
|
| 31 |
+
- config_name: humans_extra
|
| 32 |
+
data_files:
|
| 33 |
+
- split: train
|
| 34 |
+
path: extension-data/humans-*.tar
|
| 35 |
- config_name: jobs
|
| 36 |
data_files:
|
| 37 |
- split: train
|
|
|
|
| 319 |
dtype: string
|
| 320 |
- config_name: base
|
| 321 |
features: *id001
|
| 322 |
+
- config_name: humans_extra
|
| 323 |
+
features: *id001
|
| 324 |
- config_name: jobs
|
| 325 |
features: *id001
|
| 326 |
---
|
|
|
|
| 333 |
|
| 334 |
# Vivarium warm-painted greenscreen people and special characters
|
| 335 |
|
| 336 |
+
**Combined uploaded snapshot: 5,030/7,500 images.** The collection comprises an original 500-person series, an extension of 240 adult people with the same ten emotions, and 100 fantasy / science-fiction specials with one neutral portrait each. All images are 832×1,248, in the selected Ghibli-inspired warm-painted style, with solid greenscreen backgrounds. The original collection has 5,000/5,000 images uploaded; the extension has 30/2,500.
|
| 337 |
|
| 338 |
See the detailed [extension allocation and 25-class special taxonomy](EXTENSIONS.md), including all 100 variants, exact prompt plans, CSVs, inference examples and measured progress. The base model is [FLUX.2-klein-base-9B](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B); the [rank-64 character LoRA](https://huggingface.co/laion/FLUX.2-klein-base-9B-vivarium-loras) is linked with examples and inference instructions. Native generation uses **50 steps, real CFG 4 and BF16**.
|
| 339 |
|
metadata/extension/combined-allocation.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
"special_identities": 100,
|
| 4 |
"identities": 840,
|
| 5 |
"target_images": 7500,
|
| 6 |
-
"uploaded_images":
|
| 7 |
"human_gender_counts": {
|
| 8 |
"male": 370,
|
| 9 |
"female": 370
|
|
|
|
| 3 |
"special_identities": 100,
|
| 4 |
"identities": 840,
|
| 5 |
"target_images": 7500,
|
| 6 |
+
"uploaded_images": 5030,
|
| 7 |
"human_gender_counts": {
|
| 8 |
"male": 370,
|
| 9 |
"female": 370
|
metadata/extension/inference-records.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
metadata/extension/performance.json
CHANGED
|
@@ -5,9 +5,9 @@
|
|
| 5 |
"median_seconds": null
|
| 6 |
},
|
| 7 |
"reference_edit": {
|
| 8 |
-
"samples":
|
| 9 |
-
"mean_seconds":
|
| 10 |
-
"median_seconds":
|
| 11 |
},
|
| 12 |
"special": {
|
| 13 |
"samples": 0,
|
|
|
|
| 5 |
"median_seconds": null
|
| 6 |
},
|
| 7 |
"reference_edit": {
|
| 8 |
+
"samples": 64,
|
| 9 |
+
"mean_seconds": 39.995908864097146,
|
| 10 |
+
"median_seconds": 39.89882088638842
|
| 11 |
},
|
| 12 |
"special": {
|
| 13 |
"samples": 0,
|
metadata/extension/progress.json
CHANGED
|
@@ -1,14 +1,18 @@
|
|
| 1 |
{
|
| 2 |
-
"utc": "2026-10-
|
| 3 |
"people": {
|
| 4 |
-
"
|
| 5 |
-
"queued":
|
|
|
|
| 6 |
},
|
| 7 |
-
"shards": {
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
| 11 |
"target_identities": 340,
|
| 12 |
"target_images": 2500,
|
| 13 |
-
"quality_gate_passed":
|
| 14 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"utc": "2026-10-07T00:10:19.394090+00:00",
|
| 3 |
"people": {
|
| 4 |
+
"done": 14,
|
| 5 |
+
"queued": 318,
|
| 6 |
+
"running": 8
|
| 7 |
},
|
| 8 |
+
"shards": {
|
| 9 |
+
"ready": 11,
|
| 10 |
+
"uploaded": 3
|
| 11 |
+
},
|
| 12 |
+
"images_generated": 118,
|
| 13 |
+
"images_in_closed_shards": 86,
|
| 14 |
+
"images_uploaded": 30,
|
| 15 |
"target_identities": 340,
|
| 16 |
"target_images": 2500,
|
| 17 |
+
"quality_gate_passed": true
|
| 18 |
}
|
metadata/extension/provenance.json
CHANGED
|
@@ -22,8 +22,8 @@
|
|
| 22 |
],
|
| 23 |
"neutral_reference_sha_is": "SHA256 of full-size neutral PNG; resize with PIL BICUBIC for actual conditioning",
|
| 24 |
"plan_sha256": "d835a6c9d456f97c082070ec27773d3bf95d055fa70bdb344ec9a976568447ca",
|
| 25 |
-
"original_plan_sha256": "
|
| 26 |
-
"seed_method": "
|
| 27 |
"software": {
|
| 28 |
"torch": "2.7.1+cu126",
|
| 29 |
"transformers": "5.18.0",
|
|
|
|
| 22 |
],
|
| 23 |
"neutral_reference_sha_is": "SHA256 of full-size neutral PNG; resize with PIL BICUBIC for actual conditioning",
|
| 24 |
"plan_sha256": "d835a6c9d456f97c082070ec27773d3bf95d055fa70bdb344ec9a976568447ca",
|
| 25 |
+
"original_plan_sha256": "4496d2eafc99316d795fc10010a5eee37a144c5a0910947306deac1c323f2067",
|
| 26 |
+
"seed_method": "Original identity seeds: first32 bits,big-endian,of SHA256(vivarium-people-2026-10-06:<personality_id>). Under20 safety retries use actual per-expression seeds in the plan and PNG JSON; seed_strategy=safety-per-emotion-attempt.",
|
| 27 |
"software": {
|
| 28 |
"torch": "2.7.1+cu126",
|
| 29 |
"transformers": "5.18.0",
|
metadata/extension/quality-gate-passed.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"status": "passed",
|
| 3 |
+
"utc": "2026-10-07T00:09:12.475425+00:00",
|
| 4 |
+
"actually_reviewed_images": 26,
|
| 5 |
+
"actually_reviewed_profiles": [
|
| 6 |
+
"special-0001",
|
| 7 |
+
"special-0009",
|
| 8 |
+
"special-0013",
|
| 9 |
+
"special-0029",
|
| 10 |
+
"special-0085",
|
| 11 |
+
"special-0053",
|
| 12 |
+
"person-0501",
|
| 13 |
+
"person-0551"
|
| 14 |
+
],
|
| 15 |
+
"image_sha256": {
|
| 16 |
+
"special-0001-neutral": "3b5f334a66ce285707dc6958396396d6a97332eefc4ef384bbee647270379688",
|
| 17 |
+
"special-0009-neutral": "99021e069e3149f61a63da30935f1b4789582c4c5a0589a973b47873eac417bc",
|
| 18 |
+
"special-0013-neutral": "66e12e87db09e92aa01a8c18b733408f7d7320e67bbf93774bf04b24fddd6e98",
|
| 19 |
+
"special-0029-neutral": "029f60e392fbcd6c82c845cb4ac92c591f15f44b8442d7a18def5d5ac85ac02c",
|
| 20 |
+
"special-0085-neutral": "31277146228bf2994014ebf22e5ffa4e06a533938c59fe6cc945c6a1bbdab809",
|
| 21 |
+
"special-0053-neutral": "cbd5830469a96f696b01473fc6e7c2267bae5bf17960cfac89bf110a7e37d6c3",
|
| 22 |
+
"person-0501-neutral": "2ed196f1a322d54fb0237f84e72b5fd791f594742ebfdecad88b49497cf9c1fc",
|
| 23 |
+
"person-0501-joyful": "33748c1e610bc91330e8d3802afd99979303ec5ceebddffd67761106aca87875",
|
| 24 |
+
"person-0501-grateful": "46e8b3f641bb4969ace0e738b780150f7697bcc869c031f413426b509103a2f5",
|
| 25 |
+
"person-0501-playful": "a9444c8f6724f215d2375072424fbf6f65d0d150edf785cf0bfbd141febc1048",
|
| 26 |
+
"person-0501-angry": "e024e8e975045f01a79f97b6a1470b6c9f0dfa9b87f4e002c08ab0853251e66a",
|
| 27 |
+
"person-0501-afraid": "66a4e4da41d6f27bf8052d8a1904abcc79e7021345f0e4f041520117d0526f68",
|
| 28 |
+
"person-0501-sad": "c79295db19c28829846ae70efe351458ef5e15cde548533d67967033525bc27b",
|
| 29 |
+
"person-0501-annoyed": "5594931d6133c0eeeb18b34125271451102b99f9f6db5cc982d835f6f0232c3b",
|
| 30 |
+
"person-0501-pain": "e66ab8a21b0db882da91714d24a9ad1f87e401badde4878b482eb1f21de9490c",
|
| 31 |
+
"person-0501-disgust": "b2584ef352a20c0d160d2085964ad09a14f02fc2f4ba562c73b6e0862e6243fa",
|
| 32 |
+
"person-0551-neutral": "f157bbf8cb4faa3260304ae3b0d438572ed9a355ec3c69edc49de6c2b8ff0963",
|
| 33 |
+
"person-0551-joyful": "80b28d356d70c406429bd86b79672181ed71040b9322fcad3c98acbfed839579",
|
| 34 |
+
"person-0551-grateful": "f746a01bc4032cef5bf0b2e314f452d4fce0b65f94f246f03e72d44134b9ea64",
|
| 35 |
+
"person-0551-playful": "11b5aacac00e0d53649991bd16d3672f40709127113b84548d1a02625c535d72",
|
| 36 |
+
"person-0551-angry": "61aed815aa39f6f4a26e1a0167a7cf2a320a7c965702c245fe17a8702fa8c739",
|
| 37 |
+
"person-0551-afraid": "41e01e2d9c6753e29f35d6dee27d5374520b0299d14401350f8b631b2ae4b8a3",
|
| 38 |
+
"person-0551-sad": "9041e354b0a9a79eae883b9280e2e03c312867d4f0a69200d6586507d5fe39ae",
|
| 39 |
+
"person-0551-annoyed": "57d777e2c5d65fd52caa729271826674092bea1ba6b781ac1fc450cdc65d87ba",
|
| 40 |
+
"person-0551-pain": "011bf5e8950474465a10c7da0c6eef644ebe7282f5c26f296a397e131834f98a",
|
| 41 |
+
"person-0551-disgust": "4defa5d1f5ee3ac851921d11ae80c847bb7603b1a7320ef91d6704b842205cfe"
|
| 42 |
+
},
|
| 43 |
+
"criteria": [
|
| 44 |
+
"All six predefined special archetype pilots visually inspected",
|
| 45 |
+
"Two complete adult male/female ten-emotion series visually inspected",
|
| 46 |
+
"Warm painted style,fully clothed human sprites and closely matched identity/outfit accepted"
|
| 47 |
+
]
|
| 48 |
+
}
|
metadata/extension/quality-review.json
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"status": "accepted_visual_pilots",
|
| 3 |
+
"utc": "2026-10-07T00:09:12.475087+00:00",
|
| 4 |
+
"reviewed_ids": [
|
| 5 |
+
"person-0501-afraid",
|
| 6 |
+
"person-0501-angry",
|
| 7 |
+
"person-0501-annoyed",
|
| 8 |
+
"person-0501-disgust",
|
| 9 |
+
"person-0501-grateful",
|
| 10 |
+
"person-0501-joyful",
|
| 11 |
+
"person-0501-neutral",
|
| 12 |
+
"person-0501-pain",
|
| 13 |
+
"person-0501-playful",
|
| 14 |
+
"person-0501-sad",
|
| 15 |
+
"person-0551-afraid",
|
| 16 |
+
"person-0551-angry",
|
| 17 |
+
"person-0551-annoyed",
|
| 18 |
+
"person-0551-disgust",
|
| 19 |
+
"person-0551-grateful",
|
| 20 |
+
"person-0551-joyful",
|
| 21 |
+
"person-0551-neutral",
|
| 22 |
+
"person-0551-pain",
|
| 23 |
+
"person-0551-playful",
|
| 24 |
+
"person-0551-sad",
|
| 25 |
+
"special-0001-neutral",
|
| 26 |
+
"special-0009-neutral",
|
| 27 |
+
"special-0013-neutral",
|
| 28 |
+
"special-0029-neutral",
|
| 29 |
+
"special-0053-neutral",
|
| 30 |
+
"special-0085-neutral"
|
| 31 |
+
],
|
| 32 |
+
"reviewed_image_sha256": {
|
| 33 |
+
"special-0001-neutral": "3b5f334a66ce285707dc6958396396d6a97332eefc4ef384bbee647270379688",
|
| 34 |
+
"special-0009-neutral": "99021e069e3149f61a63da30935f1b4789582c4c5a0589a973b47873eac417bc",
|
| 35 |
+
"special-0013-neutral": "66e12e87db09e92aa01a8c18b733408f7d7320e67bbf93774bf04b24fddd6e98",
|
| 36 |
+
"special-0029-neutral": "029f60e392fbcd6c82c845cb4ac92c591f15f44b8442d7a18def5d5ac85ac02c",
|
| 37 |
+
"special-0085-neutral": "31277146228bf2994014ebf22e5ffa4e06a533938c59fe6cc945c6a1bbdab809",
|
| 38 |
+
"special-0053-neutral": "cbd5830469a96f696b01473fc6e7c2267bae5bf17960cfac89bf110a7e37d6c3",
|
| 39 |
+
"person-0501-neutral": "2ed196f1a322d54fb0237f84e72b5fd791f594742ebfdecad88b49497cf9c1fc",
|
| 40 |
+
"person-0501-joyful": "33748c1e610bc91330e8d3802afd99979303ec5ceebddffd67761106aca87875",
|
| 41 |
+
"person-0501-grateful": "46e8b3f641bb4969ace0e738b780150f7697bcc869c031f413426b509103a2f5",
|
| 42 |
+
"person-0501-playful": "a9444c8f6724f215d2375072424fbf6f65d0d150edf785cf0bfbd141febc1048",
|
| 43 |
+
"person-0501-angry": "e024e8e975045f01a79f97b6a1470b6c9f0dfa9b87f4e002c08ab0853251e66a",
|
| 44 |
+
"person-0501-afraid": "66a4e4da41d6f27bf8052d8a1904abcc79e7021345f0e4f041520117d0526f68",
|
| 45 |
+
"person-0501-sad": "c79295db19c28829846ae70efe351458ef5e15cde548533d67967033525bc27b",
|
| 46 |
+
"person-0501-annoyed": "5594931d6133c0eeeb18b34125271451102b99f9f6db5cc982d835f6f0232c3b",
|
| 47 |
+
"person-0501-pain": "e66ab8a21b0db882da91714d24a9ad1f87e401badde4878b482eb1f21de9490c",
|
| 48 |
+
"person-0501-disgust": "b2584ef352a20c0d160d2085964ad09a14f02fc2f4ba562c73b6e0862e6243fa",
|
| 49 |
+
"person-0551-neutral": "f157bbf8cb4faa3260304ae3b0d438572ed9a355ec3c69edc49de6c2b8ff0963",
|
| 50 |
+
"person-0551-joyful": "80b28d356d70c406429bd86b79672181ed71040b9322fcad3c98acbfed839579",
|
| 51 |
+
"person-0551-grateful": "f746a01bc4032cef5bf0b2e314f452d4fce0b65f94f246f03e72d44134b9ea64",
|
| 52 |
+
"person-0551-playful": "11b5aacac00e0d53649991bd16d3672f40709127113b84548d1a02625c535d72",
|
| 53 |
+
"person-0551-angry": "61aed815aa39f6f4a26e1a0167a7cf2a320a7c965702c245fe17a8702fa8c739",
|
| 54 |
+
"person-0551-afraid": "41e01e2d9c6753e29f35d6dee27d5374520b0299d14401350f8b631b2ae4b8a3",
|
| 55 |
+
"person-0551-sad": "9041e354b0a9a79eae883b9280e2e03c312867d4f0a69200d6586507d5fe39ae",
|
| 56 |
+
"person-0551-annoyed": "57d777e2c5d65fd52caa729271826674092bea1ba6b781ac1fc450cdc65d87ba",
|
| 57 |
+
"person-0551-pain": "011bf5e8950474465a10c7da0c6eef644ebe7282f5c26f296a397e131834f98a",
|
| 58 |
+
"person-0551-disgust": "4defa5d1f5ee3ac851921d11ae80c847bb7603b1a7320ef91d6704b842205cfe"
|
| 59 |
+
},
|
| 60 |
+
"images_reviewed": 26,
|
| 61 |
+
"profiles_reviewed": {
|
| 62 |
+
"special-0001": {
|
| 63 |
+
"record_type": "special",
|
| 64 |
+
"age_years": 0,
|
| 65 |
+
"lora_scale": 1.0,
|
| 66 |
+
"special_class": "vampire"
|
| 67 |
+
},
|
| 68 |
+
"special-0009": {
|
| 69 |
+
"record_type": "special",
|
| 70 |
+
"age_years": 0,
|
| 71 |
+
"lora_scale": 1.0,
|
| 72 |
+
"special_class": "western_dragon"
|
| 73 |
+
},
|
| 74 |
+
"special-0013": {
|
| 75 |
+
"record_type": "special",
|
| 76 |
+
"age_years": 0,
|
| 77 |
+
"lora_scale": 1.0,
|
| 78 |
+
"special_class": "serpentine_dragon"
|
| 79 |
+
},
|
| 80 |
+
"special-0029": {
|
| 81 |
+
"record_type": "special",
|
| 82 |
+
"age_years": 0,
|
| 83 |
+
"lora_scale": 1.0,
|
| 84 |
+
"special_class": "orc"
|
| 85 |
+
},
|
| 86 |
+
"special-0085": {
|
| 87 |
+
"record_type": "special",
|
| 88 |
+
"age_years": 0,
|
| 89 |
+
"lora_scale": 1.0,
|
| 90 |
+
"special_class": "lovecraftian"
|
| 91 |
+
},
|
| 92 |
+
"special-0053": {
|
| 93 |
+
"record_type": "special",
|
| 94 |
+
"age_years": 0,
|
| 95 |
+
"lora_scale": 1.0,
|
| 96 |
+
"special_class": "robot"
|
| 97 |
+
},
|
| 98 |
+
"person-0501": {
|
| 99 |
+
"record_type": "human",
|
| 100 |
+
"age_years": 25,
|
| 101 |
+
"lora_scale": 1.0,
|
| 102 |
+
"special_class": ""
|
| 103 |
+
},
|
| 104 |
+
"person-0551": {
|
| 105 |
+
"record_type": "human",
|
| 106 |
+
"age_years": 23,
|
| 107 |
+
"lora_scale": 1.0,
|
| 108 |
+
"special_class": ""
|
| 109 |
+
}
|
| 110 |
+
},
|
| 111 |
+
"complete_human_expression_groups_reviewed": 2,
|
| 112 |
+
"special_pilots_reviewed": 6,
|
| 113 |
+
"findings": [
|
| 114 |
+
"Actually inspected full-body sprites of all six special pilots:clothed vampire,western dragon,serpentine dragon,clothed orc,floating friendly Lovecraft-inspired creature and brass robot. Warm painted style and clean greenscreens are coherent; no graphic injuries or sexual presentation. Nonhuman anatomy is stylized and may add minor unexpected details such as the robot tail.",
|
| 115 |
+
"Actually inspected full-body and enlarged-face sheets of all ten expressions for male adult0501 and female adult0551. Identity,hair,outfit,pose and skin remain closely matched. Mild joyful,grateful,playful,anger and annoyance render naturally; mild negative expressions can overlap. Outfits are fully covered everyday layers.",
|
| 116 |
+
"Age is an intended prompt attribute. Painted young adults can resemble adjacent teen groups; no claim of a visual ground-truth age or exact pixel identity. Future numerical-under20 humans have a separate automatic detector gate before upload."
|
| 117 |
+
],
|
| 118 |
+
"limitations": [
|
| 119 |
+
"Reference edits can slightly change detail,folds,lighting or pose",
|
| 120 |
+
"Mild fear,sadness,pain and disgust can overlap",
|
| 121 |
+
"Fantasy creatures retain the chosen friendly illustrated style rather than graphic horror"
|
| 122 |
+
]
|
| 123 |
+
}
|
metadata/extension/schedule.json
CHANGED
|
@@ -1,9 +1,7 @@
|
|
| 1 |
{
|
| 2 |
-
"status": "
|
| 3 |
-
"utc": "2026-10-
|
| 4 |
-
"base_target": 5000,
|
| 5 |
"extension_target": 2500,
|
| 6 |
"combined_target": 7500,
|
| 7 |
-
"
|
| 8 |
-
"quality_gate": "Six special pilot portraits and adult reference-expression groups reviewed before extension uploads"
|
| 9 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"status": "running",
|
| 3 |
+
"utc": "2026-10-06T23:59:38.807197+00:00",
|
|
|
|
| 4 |
"extension_target": 2500,
|
| 5 |
"combined_target": 7500,
|
| 6 |
+
"base_completion_utc": "2026-10-06T23:56:49.702631+00:00"
|
|
|
|
| 7 |
}
|
metadata/extension/shards.json
CHANGED
|
@@ -1 +1,156 @@
|
|
| 1 |
-
[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"name": "humans-g0-00001.tar",
|
| 4 |
+
"worker": 0,
|
| 5 |
+
"count": 10,
|
| 6 |
+
"bytes": 11601920,
|
| 7 |
+
"sha256": "2af558d1c366779f799657a052f7bd6192f8e9b654c3901446fa1458be61e5e8",
|
| 8 |
+
"status": "ready",
|
| 9 |
+
"revision": null,
|
| 10 |
+
"created": "2026-10-07T00:07:19.176211+00:00",
|
| 11 |
+
"uploaded": null
|
| 12 |
+
},
|
| 13 |
+
{
|
| 14 |
+
"name": "humans-g1-00001.tar",
|
| 15 |
+
"worker": 1,
|
| 16 |
+
"count": 10,
|
| 17 |
+
"bytes": 11468800,
|
| 18 |
+
"sha256": "88859595abddb1ae61cd62e4e4074b1c44f1fca635c4e0355da12bffefcd73ee",
|
| 19 |
+
"status": "ready",
|
| 20 |
+
"revision": null,
|
| 21 |
+
"created": "2026-10-07T00:07:14.838874+00:00",
|
| 22 |
+
"uploaded": null
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"name": "humans-g2-00001.tar",
|
| 26 |
+
"worker": 2,
|
| 27 |
+
"count": 10,
|
| 28 |
+
"bytes": 10823680,
|
| 29 |
+
"sha256": "fb2fdabe8da47b7b0ba1eda91b9d028a4efecca08f12cc88a972741af29bf47f",
|
| 30 |
+
"status": "uploaded",
|
| 31 |
+
"revision": "a294da3056d2fac4a4b34f98f02a84c7d27bf90b",
|
| 32 |
+
"created": "2026-10-07T00:07:07.649354+00:00",
|
| 33 |
+
"uploaded": "2026-10-07T00:10:16.131946+00:00"
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"name": "humans-g3-00000.tar",
|
| 37 |
+
"worker": 3,
|
| 38 |
+
"count": 10,
|
| 39 |
+
"bytes": 10833920,
|
| 40 |
+
"sha256": "97fafdbdf4b857552fb0b793776bfb12320b92aa1d67e8a62edfceb5ca5fc3fe",
|
| 41 |
+
"status": "ready",
|
| 42 |
+
"revision": null,
|
| 43 |
+
"created": "2026-10-07T00:07:12.855938+00:00",
|
| 44 |
+
"uploaded": null
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
"name": "humans-g4-00001.tar",
|
| 48 |
+
"worker": 4,
|
| 49 |
+
"count": 10,
|
| 50 |
+
"bytes": 11253760,
|
| 51 |
+
"sha256": "4483a824fd25fe4c05acc6e33492dbc9aebfa870187b517f418d646b798f3d17",
|
| 52 |
+
"status": "ready",
|
| 53 |
+
"revision": null,
|
| 54 |
+
"created": "2026-10-07T00:07:17.267168+00:00",
|
| 55 |
+
"uploaded": null
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"name": "humans-g5-00001.tar",
|
| 59 |
+
"worker": 5,
|
| 60 |
+
"count": 10,
|
| 61 |
+
"bytes": 11284480,
|
| 62 |
+
"sha256": "c2ab3e7218d199b8ffa92988a966ad179c7c4d8ba41da9a6d3a1b0197d88dd5d",
|
| 63 |
+
"status": "uploaded",
|
| 64 |
+
"revision": "d05c2cdd259aa975d588d411286d821cee06e305",
|
| 65 |
+
"created": "2026-10-07T00:07:11.692561+00:00",
|
| 66 |
+
"uploaded": "2026-10-07T00:10:18.404021+00:00"
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"name": "humans-g6-00001.tar",
|
| 70 |
+
"worker": 6,
|
| 71 |
+
"count": 10,
|
| 72 |
+
"bytes": 11243520,
|
| 73 |
+
"sha256": "70d45b09cb8d2e71c594fd40d280d73152be39c12756a390f21d2b8f83739c1f",
|
| 74 |
+
"status": "uploaded",
|
| 75 |
+
"revision": "eaa4e709fad0de14fe79b20ad1405af45f8fbd1b",
|
| 76 |
+
"created": "2026-10-07T00:07:11.316909+00:00",
|
| 77 |
+
"uploaded": "2026-10-07T00:10:17.329538+00:00"
|
| 78 |
+
},
|
| 79 |
+
{
|
| 80 |
+
"name": "humans-g7-00000.tar",
|
| 81 |
+
"worker": 7,
|
| 82 |
+
"count": 10,
|
| 83 |
+
"bytes": 11202560,
|
| 84 |
+
"sha256": "e3df7d3fdf04403000b44168bca5cb2bf4bda6f064e8147f0f2861cc9e192043",
|
| 85 |
+
"status": "ready",
|
| 86 |
+
"revision": null,
|
| 87 |
+
"created": "2026-10-07T00:07:20.848190+00:00",
|
| 88 |
+
"uploaded": null
|
| 89 |
+
},
|
| 90 |
+
{
|
| 91 |
+
"name": "specials-g0-00000.tar",
|
| 92 |
+
"worker": 0,
|
| 93 |
+
"count": 1,
|
| 94 |
+
"bytes": 1085440,
|
| 95 |
+
"sha256": "b3ee1b4c62b6e9a35e85a123f6ce48fe68ecb34fbc9190f2f0e18302a77d75f4",
|
| 96 |
+
"status": "ready",
|
| 97 |
+
"revision": null,
|
| 98 |
+
"created": "2026-10-06T23:58:31.978949+00:00",
|
| 99 |
+
"uploaded": null
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
"name": "specials-g1-00000.tar",
|
| 103 |
+
"worker": 1,
|
| 104 |
+
"count": 1,
|
| 105 |
+
"bytes": 1003520,
|
| 106 |
+
"sha256": "d29f17601926fb47b16d32588d40c6a80ccfe4c486aed58a4a14bb1734de3e4c",
|
| 107 |
+
"status": "ready",
|
| 108 |
+
"revision": null,
|
| 109 |
+
"created": "2026-10-06T23:58:27.468626+00:00",
|
| 110 |
+
"uploaded": null
|
| 111 |
+
},
|
| 112 |
+
{
|
| 113 |
+
"name": "specials-g2-00000.tar",
|
| 114 |
+
"worker": 2,
|
| 115 |
+
"count": 1,
|
| 116 |
+
"bytes": 1095680,
|
| 117 |
+
"sha256": "07a499a2498a3da1af0235942754f194e754cf643f9fd0a2acd830ceca4edb92",
|
| 118 |
+
"status": "ready",
|
| 119 |
+
"revision": null,
|
| 120 |
+
"created": "2026-10-06T23:58:30.011725+00:00",
|
| 121 |
+
"uploaded": null
|
| 122 |
+
},
|
| 123 |
+
{
|
| 124 |
+
"name": "specials-g4-00000.tar",
|
| 125 |
+
"worker": 4,
|
| 126 |
+
"count": 1,
|
| 127 |
+
"bytes": 1177600,
|
| 128 |
+
"sha256": "82b40bfab107d82d2df34af2488daec74c868c6e6aa01031f52ae41117824a64",
|
| 129 |
+
"status": "ready",
|
| 130 |
+
"revision": null,
|
| 131 |
+
"created": "2026-10-06T23:58:25.663539+00:00",
|
| 132 |
+
"uploaded": null
|
| 133 |
+
},
|
| 134 |
+
{
|
| 135 |
+
"name": "specials-g5-00000.tar",
|
| 136 |
+
"worker": 5,
|
| 137 |
+
"count": 1,
|
| 138 |
+
"bytes": 1003520,
|
| 139 |
+
"sha256": "4745f4d20bea313f5daeb30609a0c116cab3885a6889544c46b6b3681b04aa39",
|
| 140 |
+
"status": "ready",
|
| 141 |
+
"revision": null,
|
| 142 |
+
"created": "2026-10-06T23:58:30.917997+00:00",
|
| 143 |
+
"uploaded": null
|
| 144 |
+
},
|
| 145 |
+
{
|
| 146 |
+
"name": "specials-g6-00000.tar",
|
| 147 |
+
"worker": 6,
|
| 148 |
+
"count": 1,
|
| 149 |
+
"bytes": 1157120,
|
| 150 |
+
"sha256": "a767f42465110ec3a84c35a54bccba676eaa13123fbd9767982c7e7a6269ca88",
|
| 151 |
+
"status": "ready",
|
| 152 |
+
"revision": null,
|
| 153 |
+
"created": "2026-10-06T23:58:27.533158+00:00",
|
| 154 |
+
"uploaded": null
|
| 155 |
+
}
|
| 156 |
+
]
|
metadata/minor-safety/public-stream-filter.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"status": "restored_after_completed_recheck_and_all_replacement_uploads",
|
| 3 |
-
"utc": "2026-10-07T00:
|
| 4 |
"included_base_images": 5000,
|
| 5 |
"withheld_base_images": 0
|
| 6 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"status": "restored_after_completed_recheck_and_all_replacement_uploads",
|
| 3 |
+
"utc": "2026-10-07T00:10:20.963161+00:00",
|
| 4 |
"included_base_images": 5000,
|
| 5 |
"withheld_base_images": 0
|
| 6 |
}
|
tools/character_extension.py
CHANGED
|
@@ -86,7 +86,8 @@ def worker(gpu):
|
|
| 86 |
event(con,gpu,'loaded');BUFFER.mkdir(parents=True,exist_ok=True)
|
| 87 |
rows=con.execute('SELECT name FROM shards WHERE worker=?',(gpu,)).fetchall()
|
| 88 |
sequence=max([int(r['name'].removesuffix('.tar').rsplit('-',1)[1]) for r in rows]+[-1])+1
|
| 89 |
-
first=True;warm_modes=set()
|
|
|
|
| 90 |
while True:
|
| 91 |
person=claim(con,gpu)
|
| 92 |
if person is None:
|
|
@@ -101,6 +102,11 @@ def worker(gpu):
|
|
| 101 |
person=claim(con,gpu,kind)
|
| 102 |
if person is None:break
|
| 103 |
wanted=float(person.get('lora_scale',1.0))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
if wanted!=scale:
|
| 105 |
import gc
|
| 106 |
del pipe;gc.collect();torch.cuda.empty_cache()
|
|
@@ -116,13 +122,22 @@ def worker(gpu):
|
|
| 116 |
im=generate_native_image(pipe,prompt_embeds=cache[e['id']],seed=e['seed'],steps=50,guidance=4.,
|
| 117 |
negative_prompt=e['negative_prompt'],image=reference if edit else None,width=832,height=1248)[0]
|
| 118 |
torch.cuda.synchronize();seconds=time.perf_counter()-t
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
b=io.BytesIO();im.save(b,format='PNG',compress_level=4);png=b.getvalue()
|
| 120 |
m=metadata(person,e,png,reference_sha,seconds,encoding[e['id']],name,'dedicated-GPU-preencoded-extension')
|
|
|
|
|
|
|
| 121 |
m['runtime']['includes_compile_warmup']=edit not in warm_modes;warm_modes.add(edit)
|
| 122 |
add_member(tar,e['id']+'.png',png);add_member(tar,e['id']+'.json',json.dumps(m,ensure_ascii=False,indent=2).encode());add_member(tar,e['id']+'.txt',e['prompt'].encode())
|
| 123 |
records.append(m);event(con,gpu,'image',dict(id=e['id'],person_id=person['personality_id'],seconds=seconds))
|
| 124 |
print(json.dumps(dict(id=e['id'],gpu=gpu,seconds=round(seconds,2))),flush=True)
|
| 125 |
if not edit:reference=im.resize((416,624),Image.Resampling.BICUBIC);reference_sha=hashlib.sha256(png).hexdigest()
|
|
|
|
|
|
|
|
|
|
| 126 |
people.append(person['personality_id']);first=False
|
| 127 |
final=BUFFER/name;partial.replace(final)
|
| 128 |
con.execute('BEGIN IMMEDIATE')
|
|
@@ -130,6 +145,7 @@ def worker(gpu):
|
|
| 130 |
for m in records:con.execute('INSERT INTO images VALUES(?,?,?,?,?)',(m['id'],m['personality_id'],m['emotion'],name,json.dumps(m,ensure_ascii=False)))
|
| 131 |
for ident in people:con.execute("UPDATE people SET status='done',finished=? WHERE id=?",(utc(),ident))
|
| 132 |
con.commit();sequence+=1
|
|
|
|
| 133 |
event(con,gpu,'complete');print('Extension worker complete',gpu,flush=True)
|
| 134 |
|
| 135 |
def upload():
|
|
@@ -139,6 +155,8 @@ def upload():
|
|
| 139 |
if not (STATE/'quality-gate-passed.json').exists():time.sleep(5);continue
|
| 140 |
for r in con.execute("SELECT * FROM shards WHERE status='ready' ORDER BY created").fetchall():
|
| 141 |
try:
|
|
|
|
|
|
|
| 142 |
path=BUFFER/r['name'];assert sha(path)==r['sha256']
|
| 143 |
commit=api.upload_file(path_or_fileobj=path,path_in_repo='extension-data/'+r['name'],repo_id=REPO,repo_type='dataset',
|
| 144 |
commit_message=f"Add {r['count']} adult/special character images: {r['name']}")
|
|
|
|
| 86 |
event(con,gpu,'loaded');BUFFER.mkdir(parents=True,exist_ok=True)
|
| 87 |
rows=con.execute('SELECT name FROM shards WHERE worker=?',(gpu,)).fetchall()
|
| 88 |
sequence=max([int(r['name'].removesuffix('.tar').rsplit('-',1)[1]) for r in rows]+[-1])+1
|
| 89 |
+
first=True;warm_modes=set();scorer=None
|
| 90 |
+
from teen_generation_safety import in_scope,screen_frame,persist_actual_plan
|
| 91 |
while True:
|
| 92 |
person=claim(con,gpu)
|
| 93 |
if person is None:
|
|
|
|
| 102 |
person=claim(con,gpu,kind)
|
| 103 |
if person is None:break
|
| 104 |
wanted=float(person.get('lora_scale',1.0))
|
| 105 |
+
if in_scope(person):
|
| 106 |
+
person['seed_strategy']='safety-per-emotion-attempt'
|
| 107 |
+
if scorer is None:
|
| 108 |
+
from laion_image_scorer import Scorer
|
| 109 |
+
scorer=Scorer('cuda:0')
|
| 110 |
if wanted!=scale:
|
| 111 |
import gc
|
| 112 |
del pipe;gc.collect();torch.cuda.empty_cache()
|
|
|
|
| 122 |
im=generate_native_image(pipe,prompt_embeds=cache[e['id']],seed=e['seed'],steps=50,guidance=4.,
|
| 123 |
negative_prompt=e['negative_prompt'],image=reference if edit else None,width=832,height=1248)[0]
|
| 124 |
torch.cuda.synchronize();seconds=time.perf_counter()-t
|
| 125 |
+
safety=None
|
| 126 |
+
if in_scope(person):
|
| 127 |
+
im,actual,safety,extra=screen_frame(pipe,person,e,im,reference if edit else None,scorer)
|
| 128 |
+
e.update(actual);seconds+=extra
|
| 129 |
b=io.BytesIO();im.save(b,format='PNG',compress_level=4);png=b.getvalue()
|
| 130 |
m=metadata(person,e,png,reference_sha,seconds,encoding[e['id']],name,'dedicated-GPU-preencoded-extension')
|
| 131 |
+
if safety is not None:
|
| 132 |
+
safety['image_sha256']=m['image_sha256'];m['safety_check']=safety
|
| 133 |
m['runtime']['includes_compile_warmup']=edit not in warm_modes;warm_modes.add(edit)
|
| 134 |
add_member(tar,e['id']+'.png',png);add_member(tar,e['id']+'.json',json.dumps(m,ensure_ascii=False,indent=2).encode());add_member(tar,e['id']+'.txt',e['prompt'].encode())
|
| 135 |
records.append(m);event(con,gpu,'image',dict(id=e['id'],person_id=person['personality_id'],seconds=seconds))
|
| 136 |
print(json.dumps(dict(id=e['id'],gpu=gpu,seconds=round(seconds,2))),flush=True)
|
| 137 |
if not edit:reference=im.resize((416,624),Image.Resampling.BICUBIC);reference_sha=hashlib.sha256(png).hexdigest()
|
| 138 |
+
if in_scope(person):
|
| 139 |
+
persist_actual_plan(STATE,'person-plan.json','personality_id',person)
|
| 140 |
+
con.execute('UPDATE people SET record=? WHERE id=?',(json.dumps(person,ensure_ascii=False,sort_keys=True),person['personality_id']));con.commit()
|
| 141 |
people.append(person['personality_id']);first=False
|
| 142 |
final=BUFFER/name;partial.replace(final)
|
| 143 |
con.execute('BEGIN IMMEDIATE')
|
|
|
|
| 145 |
for m in records:con.execute('INSERT INTO images VALUES(?,?,?,?,?)',(m['id'],m['personality_id'],m['emotion'],name,json.dumps(m,ensure_ascii=False)))
|
| 146 |
for ident in people:con.execute("UPDATE people SET status='done',finished=? WHERE id=?",(utc(),ident))
|
| 147 |
con.commit();sequence+=1
|
| 148 |
+
if scorer is not None:scorer.close()
|
| 149 |
event(con,gpu,'complete');print('Extension worker complete',gpu,flush=True)
|
| 150 |
|
| 151 |
def upload():
|
|
|
|
| 155 |
if not (STATE/'quality-gate-passed.json').exists():time.sleep(5);continue
|
| 156 |
for r in con.execute("SELECT * FROM shards WHERE status='ready' ORDER BY created").fetchall():
|
| 157 |
try:
|
| 158 |
+
from teen_generation_safety import approved_metadata
|
| 159 |
+
assert all(approved_metadata(json.loads(m[0])) for m in con.execute('SELECT metadata FROM images WHERE shard=?',(r['name'],))),'Under-20 image lacks passing exact-checksum screening'
|
| 160 |
path=BUFFER/r['name'];assert sha(path)==r['sha256']
|
| 161 |
commit=api.upload_file(path_or_fileobj=path,path_in_repo='extension-data/'+r['name'],repo_id=REPO,repo_type='dataset',
|
| 162 |
commit_message=f"Add {r['count']} adult/special character images: {r['name']}")
|
tools/supplement_card.py
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Keep new phase plans/configs present when earlier publishers update cards."""
|
| 2 |
+
import json
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
import shutil
|
| 5 |
+
import sqlite3
|
| 6 |
+
from datasets import Value
|
| 7 |
+
from webdataset_card_schema import attach_schema
|
| 8 |
+
|
| 9 |
+
ROOT=Path(__file__).resolve().parents[1]
|
| 10 |
+
|
| 11 |
+
def gate_public_base_paths(card):
|
| 12 |
+
safety=ROOT/'experiments/minor-safety'
|
| 13 |
+
if not (safety/'request.json').exists():return
|
| 14 |
+
from minor_safety_gate import approved_shard
|
| 15 |
+
c=sqlite3.connect(ROOT/'experiments/character-production/queue.sqlite');c.row_factory=sqlite3.Row
|
| 16 |
+
fully_uploaded=c.execute("SELECT COALESCE(SUM(count),0) FROM shards WHERE status='uploaded'").fetchone()[0]==5000
|
| 17 |
+
if (safety/'completion.json').exists() and fully_uploaded:
|
| 18 |
+
from background_production import dump,utc
|
| 19 |
+
dump(safety/'public-stream-filter.json',dict(status='restored_after_completed_recheck_and_all_replacement_uploads',utc=utc(),included_base_images=5000,withheld_base_images=0))
|
| 20 |
+
c.close();return
|
| 21 |
+
shards=list(c.execute("SELECT name,count,sha256 FROM shards WHERE status='uploaded' ORDER BY name"))
|
| 22 |
+
accepted=[r for r in shards if approved_shard(c,r['name'])];c.close()
|
| 23 |
+
paths=['data/'+r['name'] for r in accepted];assert paths,'No checked base TARs are available'
|
| 24 |
+
for config in card['configs']:
|
| 25 |
+
for split in config['data_files']:
|
| 26 |
+
prior=split['path'];prior=[prior] if isinstance(prior,str) else prior
|
| 27 |
+
if 'data/*.tar' in prior:split['path']=[p for p in prior if p!='data/*.tar']+paths
|
| 28 |
+
from background_production import dump,utc
|
| 29 |
+
dump(safety/'public-stream-filter.json',dict(status='active_while_repairing',utc=utc(),
|
| 30 |
+
included_shards=len(accepted),included_base_images=sum(r['count'] for r in accepted),
|
| 31 |
+
withheld_shards=len(shards)-len(accepted),withheld_base_images=sum(r['count'] for r in shards)-sum(r['count'] for r in accepted),
|
| 32 |
+
included=[dict(r) for r in accepted],policy_sha256=json.loads((safety/'policy.json').read_text())['policy_sha256']))
|
| 33 |
+
|
| 34 |
+
def uploaded(phase):
|
| 35 |
+
path=ROOT/f'experiments/{phase}/queue.sqlite'
|
| 36 |
+
if not path.exists():return 0
|
| 37 |
+
c=sqlite3.connect(path);n=c.execute("SELECT COALESCE(SUM(count),0) FROM shards WHERE status='uploaded'").fetchone()[0];c.close();return n
|
| 38 |
+
|
| 39 |
+
def extend(kind,card,body,base_shard):
|
| 40 |
+
phase='job-outfits' if kind=='characters' else 'background-drama-extension'
|
| 41 |
+
plan='image-plan.json' if kind=='characters' else 'prompt-plan.json'
|
| 42 |
+
if not (ROOT/f'experiments/{phase}/{plan}').exists():return body
|
| 43 |
+
name,prefix=('jobs','job-data') if kind=='characters' else ('drama','drama-data')
|
| 44 |
+
amount=uploaded(phase)
|
| 45 |
+
if amount:
|
| 46 |
+
pattern=prefix+'/*.tar'
|
| 47 |
+
card['configs']=[c for c in card['configs'] if c['config_name']!=name]
|
| 48 |
+
default=next(c for c in card['configs'] if c['config_name']=='default')
|
| 49 |
+
paths=default['data_files'][0]['path'];paths=[paths] if isinstance(paths,str) else list(paths)
|
| 50 |
+
if pattern not in paths:paths.append(pattern)
|
| 51 |
+
default['data_files'][0]['path']=paths
|
| 52 |
+
card['configs'].append(dict(config_name=name,data_files=[dict(split='train',path=pattern)]))
|
| 53 |
+
if kind=='characters':
|
| 54 |
+
if not any(c['config_name']=='base' for c in card['configs']):
|
| 55 |
+
card['configs'].append(dict(config_name='base',data_files=[dict(split='train',path='data/*.tar')]))
|
| 56 |
+
gate_public_base_paths(card)
|
| 57 |
+
fields=dict(record_type='string',production_phase='string',lora_scale='float64',special_class='string',special_variant='string',composition='string',
|
| 58 |
+
job_id='string',job_key='string',profession_family='string',job_title_de='string',job_title_en='string',job_outfit='string',job_outfit_index='int64',
|
| 59 |
+
base_outfit_id='string',base_outfit_style='string',base_outfit='string',base_description='string',reference_source_phase='string',
|
| 60 |
+
reference_source_repo_path='string',reference_source_shard='string',reference_source_member='string',reference_source_generated_utc='string',
|
| 61 |
+
safety_regeneration_attempt='int64',safety_regeneration_policy_sha256='string',seed_strategy='string',safety_reference_strategy='string',**{'runtime.gpu_shared_with_character_production':'bool'})
|
| 62 |
+
fields['safety_check']={
|
| 63 |
+
'max_score':Value('float64'),'attempt':Value('int64'),'recipe_variant':Value('int64'),'utc':Value('string'),'id':Value('string'),'passed':Value('bool'),
|
| 64 |
+
'image_sha256':Value('string'),'policy_sha256':Value('string'),'original_screening_policy_sha256':Value('string'),'generation_seconds':Value('float64'),'screening_seconds':Value('float64'),'positive_text_encoding_seconds':Value('float64'),'retained_original':Value('bool'),
|
| 65 |
+
'views':{view:{'clip_nsfw':Value('float64'),'efficientnet_nsfw':Value('float64'),
|
| 66 |
+
'efficientnet_classes':{label:Value('float64') for label in ['drawing','hentai','neutral','porn','sexy']}}
|
| 67 |
+
for view in ['original','foreground']}}
|
| 68 |
+
intro=f'''\n# Complete character collection and professional outfit plan
|
| 69 |
+
|
| 70 |
+
**Planned total: 840 identities, 12,140 images.** The expression/special collection contains 7,500 planned images. A further **464 adult humans × 10 professional outfits = 4,640 sprites** reuse those identities and their neutral references; they do not add new personality IDs. See [all 100 jobs and the exact outfit allocation](JOB_OUTFITS.md). Job sprites uploaded so far: **{amount:,}/4,640**. The `jobs` streaming configuration becomes available when its first TAR is uploaded.
|
| 71 |
+
|
| 72 |
+
The [teen/child detector recheck](SAFETY_RECHECK.md) reports actual image checksums, both LAION classifier scores, operational thresholds and any replacements. Intended ages, professions and demographic attributes describe prompting, not inferred real-world classifications.
|
| 73 |
+
'''
|
| 74 |
+
else:
|
| 75 |
+
fields=dict(view_type='string',business_pair_id='string',narrative_genres=[Value('string')],atmosphere='string',daylight='string')
|
| 76 |
+
intro=f'''\n# Complete environment collection and cinematic extension plan
|
| 77 |
+
|
| 78 |
+
**Planned total: 1,693 backgrounds.** In addition to the original 1,093 scenes and the 400 home/city variants, a further **200 empty contemporary cinematic locations** cover shelters, mobile-home communities, under-bridge tent camps, factories/warehouses, nightclubs, parks, forests, campgrounds, beaches, hotels and liminal urban settings. See [the cinematic taxonomy and exact plan](DRAMA_LOCATIONS.md). Cinematic extension uploaded so far: **{amount}/200**. The `drama` configuration becomes available with its first TAR.
|
| 79 |
+
'''
|
| 80 |
+
attach_schema(card,base_shard,fields)
|
| 81 |
+
return intro+body
|
| 82 |
+
|
| 83 |
+
def safety_documents(release):
|
| 84 |
+
source=ROOT/'experiments/minor-safety'
|
| 85 |
+
if not (source/'request.json').exists():return
|
| 86 |
+
target=Path(release)/'metadata/minor-safety';target.mkdir(parents=True,exist_ok=True)
|
| 87 |
+
for name in ['policy.json','baseline-policy.json','policy-transition.json','detector-provenance.json','progress.json','current-validation.json','completion.json','scores.jsonl','flagged.json','baseline-validation.json','baseline-scores.jsonl','baseline-classification-summary.json','replacement-audit.json','repair-quality-gate-passed.json','lora-gallery-recheck.json','lora-gallery-completion.json','public-stream-filter.json','scorer-equivalence.json','replacement-transaction-validation.json','regeneration-plan-validation.json','regeneration-variant-validation.json','candidate-checkpoint-validation.json','replacement-remote-snapshot.json','public-reference-index-validation.json','public-quarantine.json','public-quarantine-validation.json','public-replacement-stream-validation.json','difficult-case-visual-review.json','profile-recipe-overrides.json']:
|
| 88 |
+
if (source/name).exists():shutil.copy2(source/name,target/name)
|
| 89 |
+
snapshot=json.loads((source/'current-validation.json').read_text()) if (source/'current-validation.json').exists() else {}
|
| 90 |
+
if (source/'policy-boundary-validation.json').exists():shutil.copy2(source/'policy-boundary-validation.json',target/'policy-boundary-validation.json')
|
| 91 |
+
for extra in ['age19-scores.jsonl','age19-validation.json','future-teen-screening-validation.json','release-summary.json']:
|
| 92 |
+
if (source/extra).exists():shutil.copy2(source/extra,target/extra)
|
| 93 |
+
policy=json.loads((source/'policy.json').read_text());clip_limit=policy.get('clip_elevated_threshold',policy['elevated_threshold']);efficientnet_limit=policy.get('efficientnet_elevated_threshold',policy['elevated_threshold'])
|
| 94 |
+
current_gate=source/f'repair-quality-gate-{policy["policy_sha256"]}.json'
|
| 95 |
+
if current_gate.exists():shutil.copy2(current_gate,target/'current-policy-repair-quality-gate.json')
|
| 96 |
+
audit=json.loads((source/'replacement-audit.json').read_text()) if (source/'replacement-audit.json').exists() else []
|
| 97 |
+
changed={ident for entry in audit for ident,digest in entry['new_image_sha256'].items() if digest!=entry['old_image_sha256'][ident]}
|
| 98 |
+
age19=json.loads((source/'age19-validation.json').read_text()) if (source/'age19-validation.json').exists() else {}
|
| 99 |
+
(Path(release)/'SAFETY_RECHECK.md').write_text(f'''# Teen and child classifier recheck
|
| 100 |
+
|
| 101 |
+
Actually changed dataset PNGs: **{len(changed)}**, across **{len({entry['personality_id'] for entry in audit})} profiles**, including earlier stricter-filter replacements and the final seven-profile round. The [replacement audit](metadata/minor-safety/replacement-audit.json) distinguishes regenerated images from byte-identical retained expressions. A changed neutral requires a new coherent ten-expression series.
|
| 102 |
+
|
| 103 |
+
The [supplemental age19 report](metadata/minor-safety/age19-validation.json) additionally covers **{age19.get('images_checked',0)} existing19-year-old sprites**:40 original-base expressions and one previously public job-outfit pilot. Status: `{age19.get('status','pending')}`; flags: **{age19.get('images_flagged',0)}**. These young-adult-labelled profiles are outside the2760-category count but inside the literal under-20 check. Future human expression and professional-outfit generations with a numerical age below20 are screened inline with both models and both views before becoming uploadable. Raised candidates automatically retry with recorded actual seeds; failed searches cannot be uploaded. The [control-flow validation](metadata/minor-safety/future-teen-screening-validation.json) tests retry exhaustion, checksum binding, thresholds and concurrent plan updates; it is separate from actual model-output measurements.
|
| 104 |
+
|
| 105 |
+
Requested dataset scope: **276 identities × 10 expressions = 2,760 images**, covering babies, preschoolers, both school-age groups and both teen groups, including 18-year-olds in the older-teen category. **Six previously published child/teen model-gallery examples** are checked separately; their scores and any replacement commit are in the gallery reports. The published snapshot has checked **{snapshot.get('current_images_checked',0):,} current dataset images**; **{snapshot.get('current_images_passed',0):,} pass the operational criteria** and **{snapshot.get('current_images_flagged',0):,} require further processing**. This is an ongoing snapshot unless the linked completion report explicitly says complete.
|
| 106 |
+
|
| 107 |
+
The exact [policy](metadata/minor-safety/policy.json), [detector provenance](metadata/minor-safety/detector-provenance.json), [per-image scores](metadata/minor-safety/scores.jsonl) and [current validation](metadata/minor-safety/current-validation.json) are checksum-specific. They identify the actual PNG bytes, not only filenames. Already-public TAR contents are matched to their remote SHA256 and byte size before scoring the identical local images.
|
| 108 |
+
|
| 109 |
+
Two official LAION image models are used: the [CLIP ViT-L/14 binary classifier](https://github.com/LAION-AI/CLIP-based-NSFW-Detector) and the [LAION-SAFETY EfficientNetV2 B2 classifier](https://github.com/LAION-AI/LAION-SAFETY). The latter's drawing/neutral classes are SFW; its hentai/porn/sexy softmax scores are summed for the NSFW score. Each model sees the original portrait and a foreground crop fitted into a neutral square. CLIP uses L2-normalized projected OpenAI ViT-L/14 image embeddings; EfficientNet uses RGB0–1 and its documented260-pixel image input.
|
| 110 |
+
|
| 111 |
+
The active additional operational thresholds are **CLIP ≥{clip_limit:.2f} or EfficientNet NSFW sum ≥{efficientnet_limit:.2f} in either view**. Ordinary positive classifier outputs are included by these conservative cutoffs; outputs at least0.50 are also recorded separately as positive. These additional thresholds are project criteria, not documented guarantees or a calibration for this illustrated domain. A flagged score does not establish that an image depicts sexual content. Model scores can produce false positives and false negatives.
|
| 112 |
+
|
| 113 |
+
The [baseline class-output analysis](metadata/minor-safety/baseline-classification-summary.json) separates these additional project flags from the models' ordinary classifications. Across all2,760 original images and both views, EfficientNet's highest-scoring class is always SFW:5,406 drawing views and114 neutral views, with no hentai/porn/sexy top labels. The maximum CLIP NSFW output is0.0545109. Thus all original top-label/binary classifications are SFW; the1,662 flags come from the extra0.10 sum threshold. This illustrated-domain sensitivity is an observed limitation, not evidence of1,662 sexual images.
|
| 114 |
+
|
| 115 |
+
The original stricter0.10 policy is preserved in the [baseline policy](metadata/minor-safety/baseline-policy.json). The [declared transition](metadata/minor-safety/policy-transition.json) documents the implementation judgment behind separate cutoffs after the optional threshold-preference question; no user-selected answer was inferred. Under the0.10 CLIP/0.30 EfficientNet rule,37 original images from seven identities receive additional precautionary regeneration. Saved raw detector outputs are reevaluated against the new criteria without changing pixels or model weights; historical original scores remain preserved. Earlier0.10-screened replacements remain valid under the new rule. The six model-gallery examples already passed the stricter0.10 check.
|
| 116 |
+
|
| 117 |
+
New teen/child TARs are held until the exact image checksums pass. During repair the default/base Datasets configurations whitelist already-uploaded, checksum-approved original TARs; entire flagged TARs are temporarily omitted. The [stream-filter snapshot](metadata/minor-safety/public-stream-filter.json) records that reduced subset. Previously published TARs with unresolved flags have also been temporarily removed from current main, as recorded in the [public quarantine audit](metadata/minor-safety/public-quarantine.json); old Git revisions remain historical versions. Screened replacements return under the same TAR names. The complete500-person plan remains the target, not a claim about this temporarily filtered stream. Full wildcard streaming is restored after the recheck and all replacement uploads complete. Replacements use fully covered, age-appropriate opaque clothing and are checked again. If a neutral reference changes, all ten emotions are regenerated against the new reference. When the original neutral already passes, its exact pixels and other passing expressions are normally retained; only flagged expressions are regenerated against that same neutral. Difficult cases may instead receive a coherent fully covering outfit variant for the entire ten-image family, recorded in the [recipe overrides](metadata/minor-safety/profile-recipe-overrides.json). Every released group still has ten passing expressions. Published replacement audits distinguish changed and retained PNG hashes, parameters and the corresponding TAR changes. Individual image assets remain inside TARs.
|
| 118 |
+
|
| 119 |
+
New neutral-reference searches prefer scores below{policy.get('neutral_preference_threshold',.07):.2f} to leave room for later expression edits. Within a16-candidate search, the best neutral that meets both active model/view criteria can also be used. Already accepted candidate PNGs are checkpointed with exact prompt, seed and reference linkage. New families generated under the active policy additionally wait for a policy-specific visual review gate before upload. Full PNG/TAR integrity validation and anonymous reference-index checks are separate from classifier judgments.
|
| 120 |
+
''')
|
tools/validate_character_release.py
CHANGED
|
@@ -31,9 +31,12 @@ def validate(complete=False,extension=False):
|
|
| 31 |
shard_types.add(person.get('record_type','human'))
|
| 32 |
assert meta['id']==ident and meta['prompt']==tar.extractfile(t).read().decode()
|
| 33 |
for key,value in person.items():
|
| 34 |
-
if key
|
| 35 |
for key,value in expression.items():assert meta[key]==value,(ident,key)
|
| 36 |
digest=hashlib.sha256(data).hexdigest();assert meta['image_sha256']==digest
|
|
|
|
|
|
|
|
|
|
| 37 |
with Image.open(io.BytesIO(data)) as im:assert im.format=='PNG' and im.mode=='RGB' and im.size==(832,1248);im.verify()
|
| 38 |
with Image.open(io.BytesIO(data)) as im:im.load()
|
| 39 |
inf=meta['inference'];assert inf['revision']==BASE_REV and inf['lora_sha256']==LORA_SHA
|
|
@@ -41,7 +44,8 @@ def validate(complete=False,extension=False):
|
|
| 41 |
assert (inf['width'],inf['height'])==(832,1248) and inf['lora_rank']==64 and inf['lora_alpha']==64
|
| 42 |
assert inf['steps']==50 and inf['guidance_scale']==4. and inf['lora_scale']==float(person.get('lora_scale',1.0))
|
| 43 |
assert inf['quantization'] is False and inf['distillation'] is False and inf['dtype']=='bfloat16'
|
| 44 |
-
assert inf['seed']==meta['seed']==
|
|
|
|
| 45 |
if expression['emotion']=='neutral':
|
| 46 |
assert not meta['reference_image_sha256'] and not meta['reference_id'];neutral_hash[person['personality_id']]=digest
|
| 47 |
else:
|
|
@@ -52,7 +56,7 @@ def validate(complete=False,extension=False):
|
|
| 52 |
groups.setdefault(person['personality_id'],set()).add(expression['emotion']);seen.add(ident)
|
| 53 |
index.append(dict(id=ident,personality_id=person['personality_id'],emotion=expression['emotion'],shard=shard['name'],
|
| 54 |
repo_path=('extension-data/' if extension else 'data/')+shard['name'],
|
| 55 |
-
image_offset=png.offset_data,image_bytes=png.size,image_sha256=digest,seed=
|
| 56 |
assert len(shard_types)==1,'Each shard must contain only one record family'
|
| 57 |
for person,digest in references:assert neutral_hash[person]==digest,(person,'neutral reference SHA mismatch')
|
| 58 |
assert all(g=={e['emotion'] for e in persons[p]['expressions']} for p,g in groups.items()),'Closed shards must contain complete planned expression groups'
|
|
|
|
| 31 |
shard_types.add(person.get('record_type','human'))
|
| 32 |
assert meta['id']==ident and meta['prompt']==tar.extractfile(t).read().decode()
|
| 33 |
for key,value in person.items():
|
| 34 |
+
if key not in ['expressions','seed']:assert meta[key]==value,(ident,key)
|
| 35 |
for key,value in expression.items():assert meta[key]==value,(ident,key)
|
| 36 |
digest=hashlib.sha256(data).hexdigest();assert meta['image_sha256']==digest
|
| 37 |
+
if extension:
|
| 38 |
+
from teen_generation_safety import approved_metadata
|
| 39 |
+
assert approved_metadata(meta),(ident,'under20 screening')
|
| 40 |
with Image.open(io.BytesIO(data)) as im:assert im.format=='PNG' and im.mode=='RGB' and im.size==(832,1248);im.verify()
|
| 41 |
with Image.open(io.BytesIO(data)) as im:im.load()
|
| 42 |
inf=meta['inference'];assert inf['revision']==BASE_REV and inf['lora_sha256']==LORA_SHA
|
|
|
|
| 44 |
assert (inf['width'],inf['height'])==(832,1248) and inf['lora_rank']==64 and inf['lora_alpha']==64
|
| 45 |
assert inf['steps']==50 and inf['guidance_scale']==4. and inf['lora_scale']==float(person.get('lora_scale',1.0))
|
| 46 |
assert inf['quantization'] is False and inf['distillation'] is False and inf['dtype']=='bfloat16'
|
| 47 |
+
assert inf['seed']==meta['seed']==expression['seed']
|
| 48 |
+
if person.get('seed_strategy')!='safety-per-emotion-attempt':assert meta['seed']==person['seed']
|
| 49 |
if expression['emotion']=='neutral':
|
| 50 |
assert not meta['reference_image_sha256'] and not meta['reference_id'];neutral_hash[person['personality_id']]=digest
|
| 51 |
else:
|
|
|
|
| 56 |
groups.setdefault(person['personality_id'],set()).add(expression['emotion']);seen.add(ident)
|
| 57 |
index.append(dict(id=ident,personality_id=person['personality_id'],emotion=expression['emotion'],shard=shard['name'],
|
| 58 |
repo_path=('extension-data/' if extension else 'data/')+shard['name'],
|
| 59 |
+
image_offset=png.offset_data,image_bytes=png.size,image_sha256=digest,seed=expression['seed']))
|
| 60 |
assert len(shard_types)==1,'Each shard must contain only one record family'
|
| 61 |
for person,digest in references:assert neutral_hash[person]==digest,(person,'neutral reference SHA mismatch')
|
| 62 |
assert all(g=={e['emotion'] for e in persons[p]['expressions']} for p,g in groups.items()),'Closed shards must contain complete planned expression groups'
|
tools/webdataset_card_schema.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Explicit metadata union avoids dropping extension keys during Hub streaming."""
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
from datasets import DatasetInfo,Value,load_dataset
|
| 4 |
+
|
| 5 |
+
def attach_schema(card,base_shard,extra_fields):
|
| 6 |
+
features=load_dataset('webdataset',data_files={'train':[str(base_shard)]},split='train',streaming=True).features
|
| 7 |
+
for name,dtype in extra_fields.items():
|
| 8 |
+
target=features['json'];parts=name.split('.')
|
| 9 |
+
for part in parts[:-1]:target=target[part]
|
| 10 |
+
target[parts[-1]]=Value(dtype) if isinstance(dtype,str) else dtype
|
| 11 |
+
schema=DatasetInfo(features=features)._to_yaml_dict()['features']
|
| 12 |
+
card['dataset_info']=[dict(config_name=config['config_name'],features=schema) for config in card['configs']]
|
| 13 |
+
return features
|