Spaces:
Running
Running
mirabarukaso
commited on
Commit
·
0579f6b
1
Parent(s):
b0fc198
update counter
Browse files- app.py +1 -1
- scripts/lib.py +6 -1
app.py
CHANGED
@@ -59,4 +59,4 @@ if __name__ == '__main__':
|
|
59 |
# Use custom_prompt, the stupid js console will always report "api_info.ts:423 Too many arguments provided for the endpoint."
|
60 |
dummy_textbox.change(fn=get_prompt_manager().update_suggestions_js, inputs=[dummy_textbox], outputs=[dummy_dropdown])
|
61 |
|
62 |
-
ui.launch(
|
|
|
59 |
# Use custom_prompt, the stupid js console will always report "api_info.ts:423 Too many arguments provided for the endpoint."
|
60 |
dummy_textbox.change(fn=get_prompt_manager().update_suggestions_js, inputs=[dummy_textbox], outputs=[dummy_dropdown])
|
61 |
|
62 |
+
ui.launch()
|
scripts/lib.py
CHANGED
@@ -34,6 +34,8 @@ wai_image_dict = {}
|
|
34 |
character_list_cn = ''
|
35 |
PROMPT_MANAGER = None
|
36 |
|
|
|
|
|
37 |
wai_illustrious_character_select_files = [
|
38 |
{'name': 'wai_character', 'file_path': os.path.join(json_folder, 'wai_characters.csv'), 'url':'https://raw.githubusercontent.com/mirabarukaso/character_select_stand_alone_app/refs/heads/main/json/wai_characters.csv'},
|
39 |
{'name': 'wai_image', 'file_path': os.path.join(json_folder, 'wai_character_thumbs.json'), 'url': 'https://huggingface.co/datasets/flagrantia/character_select_stand_alone_app/resolve/main/wai_character_thumbs.json'},
|
@@ -103,6 +105,8 @@ def load_jsons():
|
|
103 |
character_list_cn.insert(0, "none")
|
104 |
|
105 |
def illustrious_character_select_ex(character = 'random', optimise_tags = True, use_cn=False):
|
|
|
|
|
106 |
chara = ''
|
107 |
|
108 |
if 'none' == character:
|
@@ -121,7 +125,8 @@ def illustrious_character_select_ex(character = 'random', optimise_tags = True,
|
|
121 |
opt_chara = chara
|
122 |
if optimise_tags:
|
123 |
opt_chara = opt_chara.replace('(', '\\(').replace(')', '\\)')
|
124 |
-
|
|
|
125 |
|
126 |
if not opt_chara.endswith(','):
|
127 |
opt_chara = f'{opt_chara},'
|
|
|
34 |
character_list_cn = ''
|
35 |
PROMPT_MANAGER = None
|
36 |
|
37 |
+
total_counter = 0
|
38 |
+
|
39 |
wai_illustrious_character_select_files = [
|
40 |
{'name': 'wai_character', 'file_path': os.path.join(json_folder, 'wai_characters.csv'), 'url':'https://raw.githubusercontent.com/mirabarukaso/character_select_stand_alone_app/refs/heads/main/json/wai_characters.csv'},
|
41 |
{'name': 'wai_image', 'file_path': os.path.join(json_folder, 'wai_character_thumbs.json'), 'url': 'https://huggingface.co/datasets/flagrantia/character_select_stand_alone_app/resolve/main/wai_character_thumbs.json'},
|
|
|
105 |
character_list_cn.insert(0, "none")
|
106 |
|
107 |
def illustrious_character_select_ex(character = 'random', optimise_tags = True, use_cn=False):
|
108 |
+
global total_counter
|
109 |
+
|
110 |
chara = ''
|
111 |
|
112 |
if 'none' == character:
|
|
|
125 |
opt_chara = chara
|
126 |
if optimise_tags:
|
127 |
opt_chara = opt_chara.replace('(', '\\(').replace(')', '\\)')
|
128 |
+
total_counter = total_counter + 1
|
129 |
+
print(f'{CAT}:{total_counter}:[{chara}]->[{opt_chara}]')
|
130 |
|
131 |
if not opt_chara.endswith(','):
|
132 |
opt_chara = f'{opt_chara},'
|