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
210cb3f9
Commit
210cb3f9
authored
Sep 16, 2022
by
kurumuz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dataset changes
parent
ebb032d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
basedformer/dataset.py
basedformer/dataset.py
+6
-2
No files found.
basedformer/dataset.py
View file @
210cb3f9
...
...
@@ -51,7 +51,7 @@ class ShardedDataset(data.Dataset):
return
(
data
[:
-
1
],
data
[
1
:])
class
ShardedImageDataset
(
data
.
Dataset
):
def
__init__
(
self
,
dataset_path
:
str
,
name
:
str
,
shuffle
=
False
,
metadata_path
=
None
,
threads
=
None
,
inner_transform
=
None
,
def
__init__
(
self
,
dataset_path
:
str
,
name
:
str
,
index_path
:
str
=
None
,
shuffle
=
False
,
metadata_path
=
None
,
threads
=
None
,
inner_transform
=
None
,
outer_transform
=
None
,
skip
=
0
,
bsz
=
256
,
world_size
=
1
,
local_rank
=
0
,
global_rank
=
0
,
device
=
"cpu"
):
self
.
skip
=
skip
self
.
threads
=
threads
...
...
@@ -61,7 +61,11 @@ class ShardedImageDataset(data.Dataset):
#for batched transforms after images become batchable
self
.
outer_transform
=
outer_transform
self
.
dataset_path
=
Path
(
dataset_path
)
self
.
index_path
=
self
.
dataset_path
/
f
"{name}.index"
if
index_path
is
None
:
self
.
index_path
=
self
.
dataset_path
/
f
"{name}.index"
else
:
self
.
index_pth
=
Path
(
index_path
)
self
.
pointer_path
=
self
.
dataset_path
/
f
"{name}.pointer"
self
.
dataset_path
=
self
.
dataset_path
/
f
"{name}.ds"
self
.
world_size
=
world_size
...
...
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