Skip to content

Commit 08feb4c

Browse files
authored
Sort straight out of the glob
1 parent fd62727 commit 08feb4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/hypernetworks/hypernetwork.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,12 @@ def load(self, filename):
219219

220220
def list_hypernetworks(path):
221221
res = {}
222-
for filename in glob.iglob(os.path.join(path, '**/*.pt'), recursive=True):
222+
for filename in sorted(glob.iglob(os.path.join(path, '**/*.pt'), recursive=True)):
223223
name = os.path.splitext(os.path.basename(filename))[0]
224224
# Prevent a hypothetical "None.pt" from being listed.
225225
if name != "None":
226226
res[name] = filename
227-
return dict(sorted(res.items()))
227+
return res
228228

229229

230230
def load_hypernetwork(filename):

0 commit comments

Comments
 (0)