update lora

This commit is contained in:
Vladimir Mandic
2023-05-16 12:24:04 -04:00
parent bc02d6668d
commit bce16a1db5
10 changed files with 208 additions and 76 deletions
+14
View File
@@ -725,6 +725,20 @@ def listfiles(dirname):
return [file for file in filenames if os.path.isfile(file)]
def walk_files(path, allowed_extensions=None):
if not os.path.exists(path):
return
if allowed_extensions is not None:
allowed_extensions = set(allowed_extensions)
for root, _dirs, files in os.walk(path):
for filename in files:
if allowed_extensions is not None:
_, ext = os.path.splitext(filename)
if ext not in allowed_extensions:
continue
yield os.path.join(root, filename)
def html_path(filename):
return os.path.join(paths.script_path, "html", filename)