Commit 08feb4c3 authored by Isaac Poulton's avatar Isaac Poulton Committed by GitHub

Sort straight out of the glob

parent fd627278
...@@ -219,12 +219,12 @@ class Hypernetwork: ...@@ -219,12 +219,12 @@ class Hypernetwork:
def list_hypernetworks(path): def list_hypernetworks(path):
res = {} res = {}
for filename in glob.iglob(os.path.join(path, '**/*.pt'), recursive=True): for filename in sorted(glob.iglob(os.path.join(path, '**/*.pt'), recursive=True)):
name = os.path.splitext(os.path.basename(filename))[0] name = os.path.splitext(os.path.basename(filename))[0]
# Prevent a hypothetical "None.pt" from being listed. # Prevent a hypothetical "None.pt" from being listed.
if name != "None": if name != "None":
res[name] = filename res[name] = filename
return dict(sorted(res.items())) return res
def load_hypernetwork(filename): def load_hypernetwork(filename):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment