Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
B
Basedformer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Basedformer
Commits
dad308db
Commit
dad308db
authored
Jul 08, 2022
by
novelailab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Danbooru id as identity
parent
7b770017
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
scripts/scrapedanbooru.py
scripts/scrapedanbooru.py
+3
-2
No files found.
scripts/scrapedanbooru.py
View file @
dad308db
...
...
@@ -66,7 +66,8 @@ new_dataset.build()
copy_chunk_size
=
4096
for
e
in
tqdm
(
range
(
0
,
len
(
can_keep_list
),
copy_chunk_size
)):
chunk
=
can_keep_list
[
e
:
e
+
copy_chunk_size
]
new_dataset
.
operate
(
lambda
id
:
old_dataset
.
read_from_id
(
id
,
decode
=
False
),
chunk
,
[
all_metadata
[
e
]
for
e
in
chunk
],
use_tqdm
=
True
)
new_dataset
.
operate
(
lambda
id
:
old_dataset
.
read_from_id
(
id
,
decode
=
False
),
chunk
,
chunk
,
use_tqdm
=
True
)
new_dataset
.
flush
()
new_dataset
.
flush_index
()
new_dataset
.
flush_metadata
()
...
...
@@ -84,7 +85,7 @@ def download_danbooru(id):
save_every
=
25
for
e
in
tqdm
(
range
(
0
,
len
(
to_scrape
),
copy_chunk_size
)):
chunk
=
to_scrape
[
e
:
e
+
copy_chunk_size
]
new_dataset
.
operate
(
download_danbooru
,
chunk
,
[
all_metadata
[
e
]
for
e
in
chunk
]
,
use_tqdm
=
True
)
new_dataset
.
operate
(
download_danbooru
,
chunk
,
chunk
,
use_tqdm
=
True
)
if
(
e
//
copy_chunk_size
)
%
save_every
==
0
:
new_dataset
.
flush
()
new_dataset
.
flush_index
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment