Spaces:
Running
on
Zero
Running
on
Zero
Upload 3 files
Browse files- env.py +2 -2
- llmdolphin.py +85 -6
- modutils.py +28 -24
env.py
CHANGED
|
@@ -71,8 +71,8 @@ load_diffusers_format_model = [
|
|
| 71 |
'KBlueLeaf/Kohaku-XL-Epsilon-rev2',
|
| 72 |
'KBlueLeaf/Kohaku-XL-Epsilon-rev3',
|
| 73 |
'KBlueLeaf/Kohaku-XL-Zeta',
|
| 74 |
-
'kayfahaarukku/UrangDiffusion-1.
|
| 75 |
-
'Eugeoter/artiwaifu-diffusion-
|
| 76 |
'Raelina/Rae-Diffusion-XL-V2',
|
| 77 |
'Raelina/Raemu-XL-V4',
|
| 78 |
]
|
|
|
|
| 71 |
'KBlueLeaf/Kohaku-XL-Epsilon-rev2',
|
| 72 |
'KBlueLeaf/Kohaku-XL-Epsilon-rev3',
|
| 73 |
'KBlueLeaf/Kohaku-XL-Zeta',
|
| 74 |
+
'kayfahaarukku/UrangDiffusion-1.3',
|
| 75 |
+
'Eugeoter/artiwaifu-diffusion-2.0',
|
| 76 |
'Raelina/Rae-Diffusion-XL-V2',
|
| 77 |
'Raelina/Raemu-XL-V4',
|
| 78 |
]
|
llmdolphin.py
CHANGED
|
@@ -25,6 +25,7 @@ llm_models = {
|
|
| 25 |
"MN-12B-Starcannon-v3.i1-Q4_K_M.gguf": ["mradermacher/MN-12B-Starcannon-v3-i1-GGUF", MessagesFormatterType.CHATML],
|
| 26 |
"MN-12B-Starcannon-v4-unofficial.i1-Q4_K_M.gguf": ["mradermacher/MN-12B-Starcannon-v4-unofficial-i1-GGUF", MessagesFormatterType.MISTRAL],
|
| 27 |
"MN-12B-Starsong-v1.i1-Q4_K_M.gguf": ["mradermacher/MN-12B-Starsong-v1-i1-GGUF", MessagesFormatterType.CHATML],
|
|
|
|
| 28 |
"Lumimaid-Magnum-12B.i1-Q4_K_M.gguf": ["mradermacher/Lumimaid-Magnum-12B-i1-GGUF", MessagesFormatterType.MISTRAL],
|
| 29 |
"Nemo-12B-Marlin-v1.i1-Q4_K_M.gguf": ["mradermacher/Nemo-12B-Marlin-v1-i1-GGUF", MessagesFormatterType.MISTRAL],
|
| 30 |
"Nemo-12B-Marlin-v2.i1-Q4_K_M.gguf": ["mradermacher/Nemo-12B-Marlin-v2-i1-GGUF", MessagesFormatterType.MISTRAL],
|
|
@@ -38,10 +39,85 @@ llm_models = {
|
|
| 38 |
"Fireball-Mistral-Nemo-Base-2407-sft-v2.2a.Q4_K_M.gguf": ["mradermacher/Fireball-Mistral-Nemo-Base-2407-sft-v2.2a-GGUF", MessagesFormatterType.MISTRAL],
|
| 39 |
"T-III-12B.Q4_K_M.gguf": ["mradermacher/T-III-12B-GGUF", MessagesFormatterType.CHATML],
|
| 40 |
"T-IIIa-12B.Q4_K_S.gguf": ["mradermacher/T-IIIa-12B-GGUF", MessagesFormatterType.MISTRAL],
|
|
|
|
| 41 |
"StorieCreative.i1-Q4_K_S.gguf": ["mradermacher/StorieCreative-i1-GGUF", MessagesFormatterType.MISTRAL],
|
| 42 |
"Deutscher-Pantheon-12B.Q4_K_M.gguf": ["mradermacher/Deutscher-Pantheon-12B-GGUF", MessagesFormatterType.MISTRAL],
|
| 43 |
"guns-and-roses-r1-Q4_K_L-imat.gguf": ["Reiterate3680/guns-and-roses-r1-GGUF", MessagesFormatterType.MISTRAL],
|
|
|
|
|
|
|
| 44 |
"Trinas_Nectar-8B-model_stock.i1-Q4_K_M.gguf": ["mradermacher/Trinas_Nectar-8B-model_stock-i1-GGUF", MessagesFormatterType.MISTRAL],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
"nemo-12b-hiwaifu-Q4_K_L-imat.gguf": ["Reiterate3680/nemo-12b-hiwaifu-GGUF", MessagesFormatterType.MISTRAL],
|
| 46 |
"Soliloquy-7B-v3-Q4_K_L-imat.gguf": ["Reiterate3680/Soliloquy-7B-v3-GGUF", MessagesFormatterType.OPEN_CHAT],
|
| 47 |
"Lyra-Gutenberg-mistral-nemo-12B.Q4_K_M.gguf": ["mradermacher/Lyra-Gutenberg-mistral-nemo-12B-GGUF", MessagesFormatterType.MISTRAL],
|
|
@@ -314,7 +390,7 @@ llm_formats = {
|
|
| 314 |
"Qwen2": MessagesFormatterType.OPEN_CHAT,
|
| 315 |
}
|
| 316 |
# https://github.com/Maximilian-Winter/llama-cpp-agent
|
| 317 |
-
llm_languages = ["English", "Japanese", "Chinese"]
|
| 318 |
llm_models_tupled_list = []
|
| 319 |
default_llm_model_filename = list(llm_models.keys())[0]
|
| 320 |
override_llm_format = None
|
|
@@ -380,7 +456,8 @@ def download_llm_model(filename):
|
|
| 380 |
if not filename in llm_models.keys(): return default_llm_model_filename
|
| 381 |
try:
|
| 382 |
hf_hub_download(repo_id = llm_models[filename][0], filename = filename, local_dir = llm_models_dir)
|
| 383 |
-
except Exception:
|
|
|
|
| 384 |
return default_llm_model_filename
|
| 385 |
update_llm_model_tupled_list()
|
| 386 |
return filename
|
|
@@ -410,7 +487,6 @@ def select_dolphin_format(format_name):
|
|
| 410 |
return gr.update(value=format_name)
|
| 411 |
|
| 412 |
|
| 413 |
-
#download_llm_models()
|
| 414 |
download_llm_model(default_llm_model_filename)
|
| 415 |
|
| 416 |
|
|
@@ -460,11 +536,14 @@ def add_dolphin_models(query, format_name):
|
|
| 460 |
if not api.repo_exists(repo_id = repo) or not api.file_exists(repo_id = repo, filename = filename): return gr.update(visible=True)
|
| 461 |
add_models[filename] = [repo, format]
|
| 462 |
else: return gr.update(visible=True)
|
| 463 |
-
except Exception:
|
|
|
|
| 464 |
return gr.update(visible=True)
|
| 465 |
-
print(add_models)
|
| 466 |
llm_models = (llm_models | add_models).copy()
|
| 467 |
-
|
|
|
|
|
|
|
| 468 |
|
| 469 |
|
| 470 |
dolphin_output_language = "English"
|
|
|
|
| 25 |
"MN-12B-Starcannon-v3.i1-Q4_K_M.gguf": ["mradermacher/MN-12B-Starcannon-v3-i1-GGUF", MessagesFormatterType.CHATML],
|
| 26 |
"MN-12B-Starcannon-v4-unofficial.i1-Q4_K_M.gguf": ["mradermacher/MN-12B-Starcannon-v4-unofficial-i1-GGUF", MessagesFormatterType.MISTRAL],
|
| 27 |
"MN-12B-Starsong-v1.i1-Q4_K_M.gguf": ["mradermacher/MN-12B-Starsong-v1-i1-GGUF", MessagesFormatterType.CHATML],
|
| 28 |
+
"StarDust-12b-v1-Q4_K_M.gguf": ["Luni/StarDust-12b-v1-GGUF", MessagesFormatterType.MISTRAL],
|
| 29 |
"Lumimaid-Magnum-12B.i1-Q4_K_M.gguf": ["mradermacher/Lumimaid-Magnum-12B-i1-GGUF", MessagesFormatterType.MISTRAL],
|
| 30 |
"Nemo-12B-Marlin-v1.i1-Q4_K_M.gguf": ["mradermacher/Nemo-12B-Marlin-v1-i1-GGUF", MessagesFormatterType.MISTRAL],
|
| 31 |
"Nemo-12B-Marlin-v2.i1-Q4_K_M.gguf": ["mradermacher/Nemo-12B-Marlin-v2-i1-GGUF", MessagesFormatterType.MISTRAL],
|
|
|
|
| 39 |
"Fireball-Mistral-Nemo-Base-2407-sft-v2.2a.Q4_K_M.gguf": ["mradermacher/Fireball-Mistral-Nemo-Base-2407-sft-v2.2a-GGUF", MessagesFormatterType.MISTRAL],
|
| 40 |
"T-III-12B.Q4_K_M.gguf": ["mradermacher/T-III-12B-GGUF", MessagesFormatterType.CHATML],
|
| 41 |
"T-IIIa-12B.Q4_K_S.gguf": ["mradermacher/T-IIIa-12B-GGUF", MessagesFormatterType.MISTRAL],
|
| 42 |
+
"Type-IV-Last-12B.Q4_K_M.gguf": ["mradermacher/Type-IV-Last-12B-GGUF", MessagesFormatterType.CHATML],
|
| 43 |
"StorieCreative.i1-Q4_K_S.gguf": ["mradermacher/StorieCreative-i1-GGUF", MessagesFormatterType.MISTRAL],
|
| 44 |
"Deutscher-Pantheon-12B.Q4_K_M.gguf": ["mradermacher/Deutscher-Pantheon-12B-GGUF", MessagesFormatterType.MISTRAL],
|
| 45 |
"guns-and-roses-r1-Q4_K_L-imat.gguf": ["Reiterate3680/guns-and-roses-r1-GGUF", MessagesFormatterType.MISTRAL],
|
| 46 |
+
"MagnumChronos.Q4_K_M.gguf": ["mradermacher/MagnumChronos-GGUF", MessagesFormatterType.CHATML],
|
| 47 |
+
"StarDust-12b-v2.i1-Q5_K_M.gguf": ["mradermacher/StarDust-12b-v2-i1-GGUF", MessagesFormatterType.CHATML],
|
| 48 |
"Trinas_Nectar-8B-model_stock.i1-Q4_K_M.gguf": ["mradermacher/Trinas_Nectar-8B-model_stock-i1-GGUF", MessagesFormatterType.MISTRAL],
|
| 49 |
+
"ChatWaifu_v1.3.1.Q4_K_M.gguf": ["mradermacher/ChatWaifu_v1.3.1-GGUF", MessagesFormatterType.MISTRAL],
|
| 50 |
+
"Lumimaid-Rocinate-v0.1.Q4_K_M.gguf": ["mradermacher/Lumimaid-Rocinate-v0.1-GGUF", MessagesFormatterType.MISTRAL],
|
| 51 |
+
"alfacentaury11b-q5_k_m.gguf": ["ClaudioItaly/AlfaCentaury11B-Q5_K_M-GGUF", MessagesFormatterType.MISTRAL],
|
| 52 |
+
"lit_red_storm-q4_k_m.gguf": ["Daemontatox/lit_red_storm-Q4_K_M-GGUF", MessagesFormatterType.LLAMA_3],
|
| 53 |
+
"llama-3-youko-8b-instruct.Q5_K_M.gguf": ["mradermacher/llama-3-youko-8b-instruct-GGUF", MessagesFormatterType.LLAMA_3],
|
| 54 |
+
"Fimbulvetr-11B-v2.Q5_K_M.gguf": ["QuantFactory/Fimbulvetr-11B-v2-GGUF", MessagesFormatterType.VICUNA],
|
| 55 |
+
"ogha-8b-model_stock-q4_k_m.gguf": ["DreadPoor/Ogha-8B-model_stock-Q4_K_M-GGUF", MessagesFormatterType.LLAMA_3],
|
| 56 |
+
"westicelemontearp-32k-7b-q5_k_s-imat.gguf": ["woofwolfy/WestIceLemonTeaRP-32k-7b-Q5_K_S-GGUF-Imatrix", MessagesFormatterType.ALPACA],
|
| 57 |
+
"ArliAI-RPMax-12B-v1.1-Q4_K_M.gguf": ["ArliAI/ArliAI-RPMax-12B-v1.1-GGUF", MessagesFormatterType.MISTRAL],
|
| 58 |
+
"l3-8b-serpentine-q4_k_m-imat.gguf": ["woofwolfy/L3-8B-Serpentine-Q4_K_M-GGUF", MessagesFormatterType.MISTRAL],
|
| 59 |
+
"llama-3-alpha-centauri-v0.1-q4_k_m-imat.gguf": ["woofwolfy/Llama-3-Alpha-Centauri-v0.1-Q4_K_M-GGUF-Imatrix", MessagesFormatterType.LLAMA_3],
|
| 60 |
+
"OpenCrystal-15B-L3-v2.i1-Q4_K_M.gguf": ["mradermacher/OpenCrystal-15B-L3-v2-i1-GGUF", MessagesFormatterType.LLAMA_3],
|
| 61 |
+
"Gukbap-Mistral-7B.i1-Q4_K_M.gguf": ["mradermacher/Gukbap-Mistral-7B-i1-GGUF", MessagesFormatterType.MISTRAL],
|
| 62 |
+
"Gukbap-Qwen2-7B.i1-Q4_K_M.gguf": ["mradermacher/Gukbap-Qwen2-7B-i1-GGUF", MessagesFormatterType.OPEN_CHAT],
|
| 63 |
+
"Irina-8B-model_stock.Q5_K_M.gguf": ["mradermacher/Irina-8B-model_stock-GGUF", MessagesFormatterType.MISTRAL],
|
| 64 |
+
"silicon-alice-7b-q5_k_m-imat.gguf": ["woofwolfy/Silicon-Alice-7B-Q5_K_M-GGUF-Imatrix", MessagesFormatterType.MISTRAL],
|
| 65 |
+
"l3.1-8b-rpgrammax-q5_k_m.gguf": ["djuna/L3.1-8B-RPGramMax-Q5_K_M-GGUF", MessagesFormatterType.LLAMA_3],
|
| 66 |
+
"Instant-RP-Noodles-12B-v1.2.Q4_K_M.gguf": ["mradermacher/Instant-RP-Noodles-12B-v1.2-GGUF", MessagesFormatterType.MISTRAL],
|
| 67 |
+
"Ellaria-9B-Q4_K_M.gguf": ["bartowski/Ellaria-9B-GGUF", MessagesFormatterType.ALPACA],
|
| 68 |
+
"evolutionstory-7b-v2.2-q5_k_m.gguf": ["ClaudioItaly/Evolutionstory-7B-v2.2-Q5_K_M-GGUF", MessagesFormatterType.MISTRAL],
|
| 69 |
+
"NeuroNoise_v2.Q6_K.gguf": ["mradermacher/NeuroNoise_v2-GGUF", MessagesFormatterType.CHATML],
|
| 70 |
+
"daybreak-kunoichi-2dpo-7b.i1-Q5_K_M.gguf": ["mradermacher/daybreak-kunoichi-2dpo-7b-i1-GGUF", MessagesFormatterType.MISTRAL],
|
| 71 |
+
"l3.1-niitorm-8b-latcosx2-q8_0.gguf": ["v000000/L3.1-Niitorm-8B-LATCOSx2-Version-Q8_0-GGUF", MessagesFormatterType.MISTRAL],
|
| 72 |
+
"IceTea21EnergyDrinkRPV13-dpo240.Q4_K_M.gguf": ["mradermacher/IceTea21EnergyDrinkRPV13-dpo240-GGUF", MessagesFormatterType.MISTRAL],
|
| 73 |
+
"topneuralstory-q6_k.gguf": ["ClaudioItaly/TopNeuralStory-Q6_K-GGUF", MessagesFormatterType.MISTRAL],
|
| 74 |
+
#"L3.1-Ablaze-Vulca-v0.2h-8B.q8_0.gguf": ["kromquant/L3.1-Ablaze-Vulca-v0.2h-8B-GGUFs", MessagesFormatterType.MISTRAL],
|
| 75 |
+
"Fireball-12B-v1.13a-philosophers.Q4_K_M.gguf": ["mradermacher/Fireball-12B-v1.13a-philosophers-GGUF", MessagesFormatterType.MISTRAL],
|
| 76 |
+
"l3.1-niitorm-8b-q8_0.gguf": ["v000000/L3.1-Niitorm-8B-t0.0001-Q8_0-GGUF", MessagesFormatterType.MISTRAL],
|
| 77 |
+
"mn-12b-lyra-v3-q5_k_m.gguf": ["HalleyStarbun/MN-12B-Lyra-v3-Q5_K_M-GGUF", MessagesFormatterType.CHATML],
|
| 78 |
+
"mergekit-model_stock-ffibbcs-q4_k_s.gguf": ["DarwinAnim8or/mergekit-model_stock-ffibbcs-Q4_K_S-GGUF", MessagesFormatterType.ALPACA],
|
| 79 |
+
"experiment-wip-being-q4_k_m.gguf": ["DreadPoor/EXPERIMENT-WIP-BEING-Q4_K_M-GGUF", MessagesFormatterType.LLAMA_3],
|
| 80 |
+
"Sunmoy-9B-G2.Q4_K_M.gguf": ["backyardai/Sunmoy-9B-G2-GGUF", MessagesFormatterType.ALPACA],
|
| 81 |
+
"kainaticulous-rp-7b.Q5_K_M.gguf": ["mradermacher/kainaticulous-rp-7b-GGUF", MessagesFormatterType.MISTRAL],
|
| 82 |
+
"OpenCrystal-12B-L3.1-128K.Q4_K_S.gguf": ["mradermacher/OpenCrystal-12B-L3.1-128K-GGUF", MessagesFormatterType.MISTRAL],
|
| 83 |
+
"L3.1-12B-Niitama-v1.1.Q4_K_S.gguf": ["mradermacher/L3.1-12B-Niitama-v1.1-GGUF", MessagesFormatterType.MISTRAL],
|
| 84 |
+
"L3.1-12B-Celeste-V1.5.Q4_K_S.gguf": ["mradermacher/L3.1-12B-Celeste-V1.5-GGUF", MessagesFormatterType.MISTRAL],
|
| 85 |
+
"L3.1-Sthenorm-8B.Q4_K_S.gguf": ["mradermacher/L3.1-Sthenorm-8B-GGUF", MessagesFormatterType.MISTRAL],
|
| 86 |
+
"MN-12B-Estrella-v2.2.Q4_K_M.gguf": ["mradermacher/MN-12B-Estrella-v2.2-GGUF", MessagesFormatterType.MISTRAL],
|
| 87 |
+
"WoonaV1.2-9b.Q4_K_M.gguf": ["QuantFactory/WoonaV1.2-9b-GGUF", MessagesFormatterType.MISTRAL],
|
| 88 |
+
"kainaticulous-rp-7B-Q5_K_M.gguf": ["kainatq/kainaticulous-rp-7b-gguf", MessagesFormatterType.MISTRAL],
|
| 89 |
+
"experiment-wip-q4_k_m.gguf": ["DreadPoor/EXPERIMENT-WIP-Q4_K_M-GGUF", MessagesFormatterType.CHATML],
|
| 90 |
+
"eye_of_the_storm-q4_k_m.gguf": ["Daemontatox/Eye_of_the_Storm-Q4_K_M-GGUF", MessagesFormatterType.MISTRAL],
|
| 91 |
+
"Fireball-3.1-8B-ORPO.i1-Q5_K_M.gguf": ["mradermacher/Fireball-3.1-8B-ORPO-i1-GGUF", MessagesFormatterType.LLAMA_3],
|
| 92 |
+
"ggml-model-Q4_K_M.gguf": ["lightblue/suzume-llama-3-8B-multilingual-orpo-borda-half-gguf", MessagesFormatterType.LLAMA_3],
|
| 93 |
+
"kukulemon-v3-soul_mix-32k-7B.Q5_K_M.gguf": ["grimjim/kukulemon-v3-soul_mix-32k-7B-GGUF", MessagesFormatterType.MISTRAL],
|
| 94 |
+
#"CestLumi-v2.Q4_K_M.gguf": ["mradermacher/CestLumi-v2-GGUF", MessagesFormatterType.CHATML], # incomplete merges according to the author
|
| 95 |
+
"zephyr-wizard-kuno-royale-BF16-merge-7B.Q5_K_M.gguf": ["grimjim/zephyr-wizard-kuno-royale-BF16-merge-7B-GGUF", MessagesFormatterType.MISTRAL],
|
| 96 |
+
"Llama-3-Luminurse-v0.2-OAS-8B.Q5_K_M.gguf": ["grimjim/Llama-3-Luminurse-v0.2-OAS-8B-GGUF", MessagesFormatterType.LLAMA_3],
|
| 97 |
+
#"L3.1-Ablaze-Vulca-v0.2b-8B.q8_0.gguf": ["kromquant/L3.1-Ablaze-Vulca-v0.2b-8B-GGUFs", MessagesFormatterType.MISTRAL],
|
| 98 |
+
"MN-12B-Lyra-v2a1.Q4_K_M.gguf": ["mradermacher/MN-12B-Lyra-v2a1-GGUF", MessagesFormatterType.MISTRAL],
|
| 99 |
+
"OpenCrystal-8B-L3.Q5_K_M.gguf": ["mradermacher/OpenCrystal-8B-L3-GGUF", MessagesFormatterType.LLAMA_3],
|
| 100 |
+
"MN-CelesteGold-12B-Merge.Q4_K_M.gguf": ["mradermacher/MN-CelesteGold-12B-Merge-GGUF", MessagesFormatterType.CHATML],
|
| 101 |
+
"L3.1-Suze-Vume-calc.Q5_K_M.gguf": ["mradermacher/L3.1-Suze-Vume-calc-GGUF", MessagesFormatterType.MISTRAL],
|
| 102 |
+
"OpenCrystal-8B-L3.i1-Q4_K_M.gguf": ["mradermacher/OpenCrystal-8B-L3-i1-GGUF", MessagesFormatterType.LLAMA_3],
|
| 103 |
+
"cestlumi-v2-q4_k_m.gguf": ["TheDrunkenSnail/CestLumi-v2-Q4_K_M-GGUF", MessagesFormatterType.MISTRAL],
|
| 104 |
+
"cestlumi-v1-q4_k_m.gguf": ["TheDrunkenSnail/CestLumi-v1-Q4_K_M-GGUF", MessagesFormatterType.MISTRAL],
|
| 105 |
+
"Lyra_Gutenbergs-Twilight_Magnum-12B-Q4_K_M.gguf": ["bartowski/Lyra_Gutenbergs-Twilight_Magnum-12B-GGUF", MessagesFormatterType.MISTRAL],
|
| 106 |
+
"llama-3.1-8b-ultra-instruct-q4_k_s-imat.gguf": ["Dampfinchen/Llama-3.1-8B-Ultra-Instruct-Q4_K_S-GGUF", MessagesFormatterType.LLAMA_3],
|
| 107 |
+
"kunoichi-lemon-royale-v3-32K-7B.Q5_K_M.gguf": ["grimjim/kunoichi-lemon-royale-v3-32K-7B-GGUF", MessagesFormatterType.MISTRAL],
|
| 108 |
+
"kukulemon-spiked-9B.Q4_K_M.gguf": ["grimjim/kukulemon-spiked-9B-GGUF", MessagesFormatterType.MISTRAL],
|
| 109 |
+
"lemonade-rebase-32k-7B.Q8_0.gguf": ["grimjim/lemonade-rebase-32k-7B-GGUF", MessagesFormatterType.MISTRAL],
|
| 110 |
+
"infinite-lemonade-7B.Q8_0.gguf": ["grimjim/infinite-lemonade-SLERP-7B-GGUF", MessagesFormatterType.MISTRAL],
|
| 111 |
+
"llama-3-merge-pp-instruct-8B.Q8_0.gguf": ["grimjim/llama-3-merge-pp-instruct-8B-GGUF", MessagesFormatterType.LLAMA_3],
|
| 112 |
+
"L3-SthenoMaidBlackroot-12.2B-V1-INSTRUCT-16fp.i1-Q4_K_S.gguf": ["mradermacher/L3-SthenoMaidBlackroot-12.2B-V1-INSTRUCT-16fp-i1-GGUF", MessagesFormatterType.LLAMA_3],
|
| 113 |
+
"Fireball-Mistral-Nemo-Base-2407-Instruct-v1.Q4_K_M.gguf": ["mradermacher/Fireball-Mistral-Nemo-Base-2407-Instruct-v1-GGUF", MessagesFormatterType.MISTRAL],
|
| 114 |
+
"L3-12B-Niitama-v1.Q4_K_M.gguf": ["mradermacher/L3-12B-Niitama-v1-GGUF", MessagesFormatterType.LLAMA_3],
|
| 115 |
+
"L3-12B-Celeste-V1.2.Q4_K_M.gguf": ["mradermacher/L3-12B-Celeste-V1.2-GGUF", MessagesFormatterType.LLAMA_3],
|
| 116 |
+
"OpenCrystal-12B-L3.Q4_K_M.gguf": ["mradermacher/OpenCrystal-12B-L3-GGUF", MessagesFormatterType.LLAMA_3],
|
| 117 |
+
"L3-Stheno-v3.2-12.2B-Instruct.Q4_K_M.gguf": ["mradermacher/L3-Stheno-v3.2-12.2B-Instruct-GGUF", MessagesFormatterType.LLAMA_3],
|
| 118 |
+
"L3-SMB-Instruct-12.2B-F32.Q4_K_M.gguf": ["mradermacher/L3-SMB-Instruct-12.2B-F32-GGUF", MessagesFormatterType.LLAMA_3],
|
| 119 |
+
"OpenCrystal-12B-L3.i1-Q4_K_M.gguf": ["mradermacher/OpenCrystal-12B-L3-i1-GGUF", MessagesFormatterType.LLAMA_3],
|
| 120 |
+
"L3-Lumimaid-12.2B-v0.1-OAS-Instruct.Q4_K_M.gguf": ["mradermacher/L3-Lumimaid-12.2B-v0.1-OAS-Instruct-GGUF", MessagesFormatterType.LLAMA_3],
|
| 121 |
"nemo-12b-hiwaifu-Q4_K_L-imat.gguf": ["Reiterate3680/nemo-12b-hiwaifu-GGUF", MessagesFormatterType.MISTRAL],
|
| 122 |
"Soliloquy-7B-v3-Q4_K_L-imat.gguf": ["Reiterate3680/Soliloquy-7B-v3-GGUF", MessagesFormatterType.OPEN_CHAT],
|
| 123 |
"Lyra-Gutenberg-mistral-nemo-12B.Q4_K_M.gguf": ["mradermacher/Lyra-Gutenberg-mistral-nemo-12B-GGUF", MessagesFormatterType.MISTRAL],
|
|
|
|
| 390 |
"Qwen2": MessagesFormatterType.OPEN_CHAT,
|
| 391 |
}
|
| 392 |
# https://github.com/Maximilian-Winter/llama-cpp-agent
|
| 393 |
+
llm_languages = ["English", "Japanese", "Chinese", "Korean", "Spanish", "Portuguese", "German", "French", "Finnish", "Russian"]
|
| 394 |
llm_models_tupled_list = []
|
| 395 |
default_llm_model_filename = list(llm_models.keys())[0]
|
| 396 |
override_llm_format = None
|
|
|
|
| 456 |
if not filename in llm_models.keys(): return default_llm_model_filename
|
| 457 |
try:
|
| 458 |
hf_hub_download(repo_id = llm_models[filename][0], filename = filename, local_dir = llm_models_dir)
|
| 459 |
+
except Exception as e:
|
| 460 |
+
print(e)
|
| 461 |
return default_llm_model_filename
|
| 462 |
update_llm_model_tupled_list()
|
| 463 |
return filename
|
|
|
|
| 487 |
return gr.update(value=format_name)
|
| 488 |
|
| 489 |
|
|
|
|
| 490 |
download_llm_model(default_llm_model_filename)
|
| 491 |
|
| 492 |
|
|
|
|
| 536 |
if not api.repo_exists(repo_id = repo) or not api.file_exists(repo_id = repo, filename = filename): return gr.update(visible=True)
|
| 537 |
add_models[filename] = [repo, format]
|
| 538 |
else: return gr.update(visible=True)
|
| 539 |
+
except Exception as e:
|
| 540 |
+
print(e)
|
| 541 |
return gr.update(visible=True)
|
| 542 |
+
#print(add_models)
|
| 543 |
llm_models = (llm_models | add_models).copy()
|
| 544 |
+
update_llm_model_tupled_list()
|
| 545 |
+
choices = get_dolphin_models()
|
| 546 |
+
return gr.update(choices=choices, value=choices[-1][1])
|
| 547 |
|
| 548 |
|
| 549 |
dolphin_output_language = "English"
|
modutils.py
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
|
|
| 1 |
import json
|
| 2 |
import gradio as gr
|
| 3 |
from huggingface_hub import HfApi
|
| 4 |
import os
|
| 5 |
from pathlib import Path
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
HF_MODEL_USER_LIKES,
|
| 12 |
-
directory_loras,
|
| 13 |
-
hf_read_token,
|
| 14 |
-
hf_token,
|
| 15 |
-
CIVITAI_API_KEY,
|
| 16 |
-
)
|
| 17 |
|
| 18 |
|
| 19 |
def get_user_agent():
|
|
@@ -112,8 +107,8 @@ def save_gallery_images(images, progress=gr.Progress(track_tqdm=True)):
|
|
| 112 |
try:
|
| 113 |
if oldpath.exists():
|
| 114 |
newpath = oldpath.resolve().rename(Path(filename).resolve())
|
| 115 |
-
except Exception:
|
| 116 |
-
|
| 117 |
finally:
|
| 118 |
output_paths.append(str(newpath))
|
| 119 |
output_images.append((str(newpath), str(filename)))
|
|
@@ -127,7 +122,8 @@ def download_private_repo(repo_id, dir_path, is_replace):
|
|
| 127 |
try:
|
| 128 |
snapshot_download(repo_id=repo_id, local_dir=dir_path, allow_patterns=['*.ckpt', '*.pt', '*.pth', '*.safetensors', '*.bin'], use_auth_token=hf_read_token)
|
| 129 |
except Exception as e:
|
| 130 |
-
print(f"Error: Failed to download {repo_id}.
|
|
|
|
| 131 |
return
|
| 132 |
if is_replace:
|
| 133 |
for file in Path(dir_path).glob("*"):
|
|
@@ -146,7 +142,8 @@ def get_private_model_list(repo_id, dir_path):
|
|
| 146 |
try:
|
| 147 |
files = api.list_repo_files(repo_id, token=hf_read_token)
|
| 148 |
except Exception as e:
|
| 149 |
-
print(f"Error: Failed to list {repo_id}.
|
|
|
|
| 150 |
return []
|
| 151 |
model_list = []
|
| 152 |
for file in files:
|
|
@@ -168,7 +165,8 @@ def download_private_file(repo_id, path, is_replace):
|
|
| 168 |
try:
|
| 169 |
hf_hub_download(repo_id=repo_id, filename=filename, local_dir=dirname, use_auth_token=hf_read_token)
|
| 170 |
except Exception as e:
|
| 171 |
-
print(f"Error: Failed to download {filename}.
|
|
|
|
| 172 |
return
|
| 173 |
if is_replace:
|
| 174 |
file.resolve().rename(newpath.resolve())
|
|
@@ -194,7 +192,8 @@ def get_model_id_list():
|
|
| 194 |
for author in HF_MODEL_USER_EX:
|
| 195 |
models_ex = api.list_models(author=author, cardData=True, sort="last_modified")
|
| 196 |
except Exception as e:
|
| 197 |
-
print(f"Error: Failed to list {author}'s models.
|
|
|
|
| 198 |
return model_ids
|
| 199 |
for model in models_likes:
|
| 200 |
model_ids.append(model.id) if not model.private else ""
|
|
@@ -218,17 +217,17 @@ def get_t2i_model_info(repo_id: str):
|
|
| 218 |
if " " in repo_id or not api.repo_exists(repo_id): return ""
|
| 219 |
model = api.model_info(repo_id=repo_id)
|
| 220 |
except Exception as e:
|
| 221 |
-
print(f"Error: Failed to get {repo_id}'s info.
|
|
|
|
| 222 |
return ""
|
| 223 |
if model.private or model.gated: return ""
|
| 224 |
tags = model.tags
|
| 225 |
info = []
|
| 226 |
url = f"https://huggingface.co/{repo_id}/"
|
| 227 |
if not 'diffusers' in tags: return ""
|
| 228 |
-
if 'diffusers:
|
| 229 |
-
|
| 230 |
-
elif 'diffusers:StableDiffusionPipeline' in tags:
|
| 231 |
-
info.append("SD1.5")
|
| 232 |
if model.card_data and model.card_data.tags:
|
| 233 |
info.extend(list_sub(model.card_data.tags, ['text-to-image', 'stable-diffusion', 'stable-diffusion-api', 'safetensors', 'stable-diffusion-xl']))
|
| 234 |
info.append(f"DLs: {model.downloads}")
|
|
@@ -247,6 +246,7 @@ def get_tupled_model_list(model_list):
|
|
| 247 |
if not api.repo_exists(repo_id): continue
|
| 248 |
model = api.model_info(repo_id=repo_id)
|
| 249 |
except Exception as e:
|
|
|
|
| 250 |
continue
|
| 251 |
if model.private or model.gated: continue
|
| 252 |
tags = model.tags
|
|
@@ -273,8 +273,8 @@ try:
|
|
| 273 |
d = json.load(f)
|
| 274 |
for k, v in d.items():
|
| 275 |
private_lora_dict[escape_lora_basename(k)] = v
|
| 276 |
-
except Exception:
|
| 277 |
-
|
| 278 |
loras_dict = {"None": ["", "", "", "", ""], "": ["", "", "", "", ""]} | private_lora_dict.copy()
|
| 279 |
civitai_not_exists_list = []
|
| 280 |
loras_url_to_path_dict = {} # {"URL to download": "local filepath", ...}
|
|
@@ -322,6 +322,7 @@ def get_civitai_info(path):
|
|
| 322 |
try:
|
| 323 |
r = session.get(url, params=params, headers=headers, stream=True, timeout=(3.0, 15))
|
| 324 |
except Exception as e:
|
|
|
|
| 325 |
return ["", "", "", "", ""]
|
| 326 |
if not r.ok: return None
|
| 327 |
json = r.json()
|
|
@@ -420,7 +421,8 @@ def copy_lora(path: str, new_path: str):
|
|
| 420 |
if cpath.exists():
|
| 421 |
try:
|
| 422 |
shutil.copy(str(cpath.resolve()), str(npath.resolve()))
|
| 423 |
-
except Exception:
|
|
|
|
| 424 |
return None
|
| 425 |
update_lora_dict(str(npath))
|
| 426 |
return new_path
|
|
@@ -1215,6 +1217,8 @@ def get_model_pipeline(repo_id: str):
|
|
| 1215 |
if model.private or model.gated: return default
|
| 1216 |
tags = model.tags
|
| 1217 |
if not 'diffusers' in tags: return default
|
|
|
|
|
|
|
| 1218 |
if 'diffusers:StableDiffusionXLPipeline' in tags:
|
| 1219 |
return "StableDiffusionXLPipeline"
|
| 1220 |
elif 'diffusers:StableDiffusionPipeline' in tags:
|
|
|
|
| 1 |
+
import spaces
|
| 2 |
import json
|
| 3 |
import gradio as gr
|
| 4 |
from huggingface_hub import HfApi
|
| 5 |
import os
|
| 6 |
from pathlib import Path
|
| 7 |
|
| 8 |
+
|
| 9 |
+
from env import (HF_LORA_PRIVATE_REPOS1, HF_LORA_PRIVATE_REPOS2,
|
| 10 |
+
HF_MODEL_USER_EX, HF_MODEL_USER_LIKES,
|
| 11 |
+
directory_loras, hf_read_token, hf_token, CIVITAI_API_KEY)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
def get_user_agent():
|
|
|
|
| 107 |
try:
|
| 108 |
if oldpath.exists():
|
| 109 |
newpath = oldpath.resolve().rename(Path(filename).resolve())
|
| 110 |
+
except Exception as e:
|
| 111 |
+
print(e)
|
| 112 |
finally:
|
| 113 |
output_paths.append(str(newpath))
|
| 114 |
output_images.append((str(newpath), str(filename)))
|
|
|
|
| 122 |
try:
|
| 123 |
snapshot_download(repo_id=repo_id, local_dir=dir_path, allow_patterns=['*.ckpt', '*.pt', '*.pth', '*.safetensors', '*.bin'], use_auth_token=hf_read_token)
|
| 124 |
except Exception as e:
|
| 125 |
+
print(f"Error: Failed to download {repo_id}.")
|
| 126 |
+
print(e)
|
| 127 |
return
|
| 128 |
if is_replace:
|
| 129 |
for file in Path(dir_path).glob("*"):
|
|
|
|
| 142 |
try:
|
| 143 |
files = api.list_repo_files(repo_id, token=hf_read_token)
|
| 144 |
except Exception as e:
|
| 145 |
+
print(f"Error: Failed to list {repo_id}.")
|
| 146 |
+
print(e)
|
| 147 |
return []
|
| 148 |
model_list = []
|
| 149 |
for file in files:
|
|
|
|
| 165 |
try:
|
| 166 |
hf_hub_download(repo_id=repo_id, filename=filename, local_dir=dirname, use_auth_token=hf_read_token)
|
| 167 |
except Exception as e:
|
| 168 |
+
print(f"Error: Failed to download {filename}.")
|
| 169 |
+
print(e)
|
| 170 |
return
|
| 171 |
if is_replace:
|
| 172 |
file.resolve().rename(newpath.resolve())
|
|
|
|
| 192 |
for author in HF_MODEL_USER_EX:
|
| 193 |
models_ex = api.list_models(author=author, cardData=True, sort="last_modified")
|
| 194 |
except Exception as e:
|
| 195 |
+
print(f"Error: Failed to list {author}'s models.")
|
| 196 |
+
print(e)
|
| 197 |
return model_ids
|
| 198 |
for model in models_likes:
|
| 199 |
model_ids.append(model.id) if not model.private else ""
|
|
|
|
| 217 |
if " " in repo_id or not api.repo_exists(repo_id): return ""
|
| 218 |
model = api.model_info(repo_id=repo_id)
|
| 219 |
except Exception as e:
|
| 220 |
+
print(f"Error: Failed to get {repo_id}'s info.")
|
| 221 |
+
print(e)
|
| 222 |
return ""
|
| 223 |
if model.private or model.gated: return ""
|
| 224 |
tags = model.tags
|
| 225 |
info = []
|
| 226 |
url = f"https://huggingface.co/{repo_id}/"
|
| 227 |
if not 'diffusers' in tags: return ""
|
| 228 |
+
if 'diffusers:FluxPipeline' in tags: info.append("FLUX.1")
|
| 229 |
+
elif 'diffusers:StableDiffusionXLPipeline' in tags: info.append("SDXL")
|
| 230 |
+
elif 'diffusers:StableDiffusionPipeline' in tags: info.append("SD1.5")
|
|
|
|
| 231 |
if model.card_data and model.card_data.tags:
|
| 232 |
info.extend(list_sub(model.card_data.tags, ['text-to-image', 'stable-diffusion', 'stable-diffusion-api', 'safetensors', 'stable-diffusion-xl']))
|
| 233 |
info.append(f"DLs: {model.downloads}")
|
|
|
|
| 246 |
if not api.repo_exists(repo_id): continue
|
| 247 |
model = api.model_info(repo_id=repo_id)
|
| 248 |
except Exception as e:
|
| 249 |
+
print(e)
|
| 250 |
continue
|
| 251 |
if model.private or model.gated: continue
|
| 252 |
tags = model.tags
|
|
|
|
| 273 |
d = json.load(f)
|
| 274 |
for k, v in d.items():
|
| 275 |
private_lora_dict[escape_lora_basename(k)] = v
|
| 276 |
+
except Exception as e:
|
| 277 |
+
print(e)
|
| 278 |
loras_dict = {"None": ["", "", "", "", ""], "": ["", "", "", "", ""]} | private_lora_dict.copy()
|
| 279 |
civitai_not_exists_list = []
|
| 280 |
loras_url_to_path_dict = {} # {"URL to download": "local filepath", ...}
|
|
|
|
| 322 |
try:
|
| 323 |
r = session.get(url, params=params, headers=headers, stream=True, timeout=(3.0, 15))
|
| 324 |
except Exception as e:
|
| 325 |
+
print(e)
|
| 326 |
return ["", "", "", "", ""]
|
| 327 |
if not r.ok: return None
|
| 328 |
json = r.json()
|
|
|
|
| 421 |
if cpath.exists():
|
| 422 |
try:
|
| 423 |
shutil.copy(str(cpath.resolve()), str(npath.resolve()))
|
| 424 |
+
except Exception as e:
|
| 425 |
+
print(e)
|
| 426 |
return None
|
| 427 |
update_lora_dict(str(npath))
|
| 428 |
return new_path
|
|
|
|
| 1217 |
if model.private or model.gated: return default
|
| 1218 |
tags = model.tags
|
| 1219 |
if not 'diffusers' in tags: return default
|
| 1220 |
+
if 'diffusers:FluxPipeline' in tags:
|
| 1221 |
+
return "FluxPipeline"
|
| 1222 |
if 'diffusers:StableDiffusionXLPipeline' in tags:
|
| 1223 |
return "StableDiffusionXLPipeline"
|
| 1224 |
elif 'diffusers:StableDiffusionPipeline' in tags:
|