Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
b69c37d2
Commit
b69c37d2
authored
Oct 20, 2022
by
guaneec
Committed by
AUTOMATIC1111
Oct 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow datasets with only 1 image in TI
parent
7157e5d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
dataset.py
modules/textual_inversion/dataset.py
+2
-2
No files found.
modules/textual_inversion/dataset.py
View file @
b69c37d2
...
...
@@ -83,7 +83,7 @@ class PersonalizedBase(Dataset):
self
.
dataset
.
append
(
entry
)
assert
len
(
self
.
dataset
)
>
1
,
"No images have been found in the dataset."
assert
len
(
self
.
dataset
)
>
0
,
"No images have been found in the dataset."
self
.
length
=
len
(
self
.
dataset
)
*
repeats
//
batch_size
self
.
initial_indexes
=
np
.
arange
(
len
(
self
.
dataset
))
...
...
@@ -91,7 +91,7 @@ class PersonalizedBase(Dataset):
self
.
shuffle
()
def
shuffle
(
self
):
self
.
indexes
=
self
.
initial_indexes
[
torch
.
randperm
(
self
.
initial_indexes
.
shape
[
0
])]
self
.
indexes
=
self
.
initial_indexes
[
torch
.
randperm
(
self
.
initial_indexes
.
shape
[
0
])
.
numpy
()
]
def
create_text
(
self
,
filename_text
):
text
=
random
.
choice
(
self
.
lines
)
...
...
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