Former-commit-id: 3c63680da9893e219bcefc1474052bab267fd8d6 [formerly 127697c3f7]
Former-commit-id: 5e1b02d9a4ab17d085c00aa7e960f0c03fc3c35e
This commit is contained in:
frostydad 2022-09-22 19:42:34 -06:00
parent 19426c9053
commit 3e5c8882f5
2 changed files with 14 additions and 22 deletions

View File

@ -51,17 +51,13 @@ jobs:
file.close() file.close()
return (size, None) return (size, None)
# Get list of model directories
# working_dir = os.getcwd()
# root_dir_list = []
# for x in os.listdir(working_dir):
# if os.path.isdir(x):
# root_dir_list.append(x)
# Get list of models under the sd-concepts-library organization # Get list of models under the sd-concepts-library organization
api = HfApi() api = HfApi()
root_dir_list = api.list_models(author="sd-concepts-library").sort() models_list = []
for model in api.list_models(author="sd-concepts-library"):
models_list.append(model.modelId.replace('sd-concepts-library/', ''))
models_list.sort()
print(models_list)
html_struct = """<!DOCTYPE html> html_struct = """<!DOCTYPE html>
<html lang="en"> <html lang="en">
@ -111,8 +107,8 @@ jobs:
# Move the model out # Move the model out
i = 1 i = 1
for model_name in root_dir_list: for model_name in models_list:
print(f'{i}/{len(root_dir_list)} -> {model_name}') print(f'{i}/{len(models_list)} -> {model_name}')
# if os.path.exists(f'{model_name}/learned_embeds.bin'): # double check the file exists since sometimes it hasn't been uploaded yet # if os.path.exists(f'{model_name}/learned_embeds.bin'): # double check the file exists since sometimes it hasn't been uploaded yet
# shutil.move(f'{model_name}/learned_embeds.bin', f'{model_name}/{model_name}.pt') # shutil.move(f'{model_name}/learned_embeds.bin', f'{model_name}/{model_name}.pt')
# pass # pass

View File

@ -26,17 +26,13 @@ def getsizes(uri):
file.close() file.close()
return (size, None) return (size, None)
# Get list of model directories
# working_dir = os.getcwd()
# root_dir_list = []
# for x in os.listdir(working_dir):
# if os.path.isdir(x):
# root_dir_list.append(x)
# Get list of models under the sd-concepts-library organization # Get list of models under the sd-concepts-library organization
api = HfApi() api = HfApi()
root_dir_list = api.list_models(author="sd-concepts-library").sort() models_list = []
for model in api.list_models(author="sd-concepts-library"):
models_list.append(model.modelId.replace('sd-concepts-library/', ''))
models_list.sort()
print(models_list)
html_struct = """<!DOCTYPE html> html_struct = """<!DOCTYPE html>
<html lang="en"> <html lang="en">
@ -86,8 +82,8 @@ html_struct = """<!DOCTYPE html>
# Move the model out # Move the model out
i = 1 i = 1
for model_name in root_dir_list: for model_name in models_list:
print(f'{i}/{len(root_dir_list)} -> {model_name}') print(f'{i}/{len(models_list)} -> {model_name}')
# if os.path.exists(f'{model_name}/learned_embeds.bin'): # double check the file exists since sometimes it hasn't been uploaded yet # if os.path.exists(f'{model_name}/learned_embeds.bin'): # double check the file exists since sometimes it hasn't been uploaded yet
# shutil.move(f'{model_name}/learned_embeds.bin', f'{model_name}/{model_name}.pt') # shutil.move(f'{model_name}/learned_embeds.bin', f'{model_name}/{model_name}.pt')
# pass # pass