Spaces:
Running
on
Zero
Running
on
Zero
Upload 2 files
Browse files- app.py +4 -4
- llmdolphin.py +19 -7
app.py
CHANGED
@@ -48,16 +48,16 @@ with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", fill_width=True, css="") as app:
|
|
48 |
chat_topp = gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p")
|
49 |
chat_topk = gr.Slider(minimum=0, maximum=100, value=40, step=1, label="Top-k")
|
50 |
chat_rp = gr.Slider(minimum=0.0, maximum=2.0, value=1.1, step=0.1, label="Repetition penalty")
|
|
|
|
|
|
|
|
|
51 |
with gr.Accordion("Modes", open=True):
|
52 |
chat_model = gr.Dropdown(choices=get_dolphin_models(), value=get_dolphin_models()[0][1], allow_custom_value=True, label="Model")
|
53 |
chat_model_info = gr.Markdown(value=get_dolphin_model_info(get_dolphin_models()[0][1]), label="Model info")
|
54 |
with gr.Row():
|
55 |
chat_mode = gr.Dropdown(choices=get_dolphin_sysprompt_mode(), value=get_dolphin_sysprompt_mode()[0], allow_custom_value=False, label="Mode")
|
56 |
chat_lang = gr.Dropdown(choices=get_dolphin_languages(), value="English", allow_custom_value=True, label="Output language")
|
57 |
-
with gr.Accordion("Add models", open=False):
|
58 |
-
chat_add_text = gr.Textbox(label="URL or Repo ID", placeholder="https://huggingface.co/mradermacher/MagnumChronos-i1-GGUF/blob/main/MagnumChronos.i1-Q4_K_M.gguf", lines=1)
|
59 |
-
chat_add_format = gr.Dropdown(choices=get_llm_formats(), value=get_llm_formats()[0], label="Message format")
|
60 |
-
chat_add_submit = gr.Button("Update lists of models")
|
61 |
with gr.Row():
|
62 |
with gr.Group():
|
63 |
output_text = gr.TextArea(label="Output tags", interactive=False, show_copy_button=True)
|
|
|
48 |
chat_topp = gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p")
|
49 |
chat_topk = gr.Slider(minimum=0, maximum=100, value=40, step=1, label="Top-k")
|
50 |
chat_rp = gr.Slider(minimum=0.0, maximum=2.0, value=1.1, step=0.1, label="Repetition penalty")
|
51 |
+
with gr.Accordion("Add models", open=False):
|
52 |
+
chat_add_text = gr.Textbox(label="URL or Repo ID", placeholder="https://huggingface.co/mradermacher/MagnumChronos-i1-GGUF/blob/main/MagnumChronos.i1-Q4_K_M.gguf", lines=1)
|
53 |
+
chat_add_format = gr.Dropdown(choices=get_llm_formats(), value=get_llm_formats()[0], label="Message format")
|
54 |
+
chat_add_submit = gr.Button("Update lists of models")
|
55 |
with gr.Accordion("Modes", open=True):
|
56 |
chat_model = gr.Dropdown(choices=get_dolphin_models(), value=get_dolphin_models()[0][1], allow_custom_value=True, label="Model")
|
57 |
chat_model_info = gr.Markdown(value=get_dolphin_model_info(get_dolphin_models()[0][1]), label="Model info")
|
58 |
with gr.Row():
|
59 |
chat_mode = gr.Dropdown(choices=get_dolphin_sysprompt_mode(), value=get_dolphin_sysprompt_mode()[0], allow_custom_value=False, label="Mode")
|
60 |
chat_lang = gr.Dropdown(choices=get_dolphin_languages(), value="English", allow_custom_value=True, label="Output language")
|
|
|
|
|
|
|
|
|
61 |
with gr.Row():
|
62 |
with gr.Group():
|
63 |
output_text = gr.TextArea(label="Output tags", interactive=False, show_copy_button=True)
|
llmdolphin.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
import gradio as gr
|
2 |
import spaces
|
|
|
3 |
from llama_cpp import Llama
|
4 |
from llama_cpp_agent import LlamaCppAgent, MessagesFormatterType
|
5 |
from llama_cpp_agent.providers import LlamaCppPythonProvider
|
@@ -44,6 +44,15 @@ llm_models = {
|
|
44 |
"guns-and-roses-r1-Q4_K_L-imat.gguf": ["Reiterate3680/guns-and-roses-r1-GGUF", MessagesFormatterType.MISTRAL],
|
45 |
"MagnumChronos.Q4_K_M.gguf": ["mradermacher/MagnumChronos-GGUF", MessagesFormatterType.CHATML],
|
46 |
"Trinas_Nectar-8B-model_stock.i1-Q4_K_M.gguf": ["mradermacher/Trinas_Nectar-8B-model_stock-i1-GGUF", MessagesFormatterType.MISTRAL],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
"experiment-wip-q4_k_m.gguf": ["DreadPoor/EXPERIMENT-WIP-Q4_K_M-GGUF", MessagesFormatterType.CHATML],
|
48 |
"eye_of_the_storm-q4_k_m.gguf": ["Daemontatox/Eye_of_the_Storm-Q4_K_M-GGUF", MessagesFormatterType.MISTRAL],
|
49 |
"Fireball-3.1-8B-ORPO.i1-Q5_K_M.gguf": ["mradermacher/Fireball-3.1-8B-ORPO-i1-GGUF", MessagesFormatterType.LLAMA_3],
|
@@ -348,7 +357,7 @@ llm_formats = {
|
|
348 |
"Qwen2": MessagesFormatterType.OPEN_CHAT,
|
349 |
}
|
350 |
# https://github.com/Maximilian-Winter/llama-cpp-agent
|
351 |
-
llm_languages = ["English", "Japanese", "Chinese"]
|
352 |
llm_models_tupled_list = []
|
353 |
default_llm_model_filename = list(llm_models.keys())[0]
|
354 |
override_llm_format = None
|
@@ -414,7 +423,8 @@ def download_llm_model(filename):
|
|
414 |
if not filename in llm_models.keys(): return default_llm_model_filename
|
415 |
try:
|
416 |
hf_hub_download(repo_id = llm_models[filename][0], filename = filename, local_dir = llm_models_dir)
|
417 |
-
except Exception:
|
|
|
418 |
return default_llm_model_filename
|
419 |
update_llm_model_tupled_list()
|
420 |
return filename
|
@@ -444,7 +454,6 @@ def select_dolphin_format(format_name):
|
|
444 |
return gr.update(value=format_name)
|
445 |
|
446 |
|
447 |
-
#download_llm_models()
|
448 |
download_llm_model(default_llm_model_filename)
|
449 |
|
450 |
|
@@ -494,11 +503,14 @@ def add_dolphin_models(query, format_name):
|
|
494 |
if not api.repo_exists(repo_id = repo) or not api.file_exists(repo_id = repo, filename = filename): return gr.update(visible=True)
|
495 |
add_models[filename] = [repo, format]
|
496 |
else: return gr.update(visible=True)
|
497 |
-
except Exception:
|
|
|
498 |
return gr.update(visible=True)
|
499 |
-
print(add_models)
|
500 |
llm_models = (llm_models | add_models).copy()
|
501 |
-
|
|
|
|
|
502 |
|
503 |
|
504 |
dolphin_output_language = "English"
|
|
|
|
|
1 |
import spaces
|
2 |
+
import gradio as gr
|
3 |
from llama_cpp import Llama
|
4 |
from llama_cpp_agent import LlamaCppAgent, MessagesFormatterType
|
5 |
from llama_cpp_agent.providers import LlamaCppPythonProvider
|
|
|
44 |
"guns-and-roses-r1-Q4_K_L-imat.gguf": ["Reiterate3680/guns-and-roses-r1-GGUF", MessagesFormatterType.MISTRAL],
|
45 |
"MagnumChronos.Q4_K_M.gguf": ["mradermacher/MagnumChronos-GGUF", MessagesFormatterType.CHATML],
|
46 |
"Trinas_Nectar-8B-model_stock.i1-Q4_K_M.gguf": ["mradermacher/Trinas_Nectar-8B-model_stock-i1-GGUF", MessagesFormatterType.MISTRAL],
|
47 |
+
"ChatWaifu_v1.3.1.Q4_K_M.gguf": ["mradermacher/ChatWaifu_v1.3.1-GGUF", MessagesFormatterType.MISTRAL],
|
48 |
+
"kainaticulous-rp-7b.Q5_K_M.gguf": ["mradermacher/kainaticulous-rp-7b-GGUF", MessagesFormatterType.MISTRAL],
|
49 |
+
"OpenCrystal-12B-L3.1-128K.Q4_K_S.gguf": ["mradermacher/OpenCrystal-12B-L3.1-128K-GGUF", MessagesFormatterType.MISTRAL],
|
50 |
+
"L3.1-12B-Niitama-v1.1.Q4_K_S.gguf": ["mradermacher/L3.1-12B-Niitama-v1.1-GGUF", MessagesFormatterType.MISTRAL],
|
51 |
+
"L3.1-12B-Celeste-V1.5.Q4_K_S.gguf": ["mradermacher/L3.1-12B-Celeste-V1.5-GGUF", MessagesFormatterType.MISTRAL],
|
52 |
+
"L3.1-Sthenorm-8B.Q4_K_S.gguf": ["mradermacher/L3.1-Sthenorm-8B-GGUF", MessagesFormatterType.MISTRAL],
|
53 |
+
"MN-12B-Estrella-v2.2.Q4_K_M.gguf": ["mradermacher/MN-12B-Estrella-v2.2-GGUF", MessagesFormatterType.MISTRAL],
|
54 |
+
"WoonaV1.2-9b.Q4_K_M.gguf": ["QuantFactory/WoonaV1.2-9b-GGUF", MessagesFormatterType.MISTRAL],
|
55 |
+
"kainaticulous-rp-7B-Q5_K_M.gguf": ["kainatq/kainaticulous-rp-7b-gguf", MessagesFormatterType.MISTRAL],
|
56 |
"experiment-wip-q4_k_m.gguf": ["DreadPoor/EXPERIMENT-WIP-Q4_K_M-GGUF", MessagesFormatterType.CHATML],
|
57 |
"eye_of_the_storm-q4_k_m.gguf": ["Daemontatox/Eye_of_the_Storm-Q4_K_M-GGUF", MessagesFormatterType.MISTRAL],
|
58 |
"Fireball-3.1-8B-ORPO.i1-Q5_K_M.gguf": ["mradermacher/Fireball-3.1-8B-ORPO-i1-GGUF", MessagesFormatterType.LLAMA_3],
|
|
|
357 |
"Qwen2": MessagesFormatterType.OPEN_CHAT,
|
358 |
}
|
359 |
# https://github.com/Maximilian-Winter/llama-cpp-agent
|
360 |
+
llm_languages = ["English", "Japanese", "Chinese", "Korean", "Spanish", "Portuguese", "German", "French", "Finnish", "Russian"]
|
361 |
llm_models_tupled_list = []
|
362 |
default_llm_model_filename = list(llm_models.keys())[0]
|
363 |
override_llm_format = None
|
|
|
423 |
if not filename in llm_models.keys(): return default_llm_model_filename
|
424 |
try:
|
425 |
hf_hub_download(repo_id = llm_models[filename][0], filename = filename, local_dir = llm_models_dir)
|
426 |
+
except Exception as e:
|
427 |
+
print(e)
|
428 |
return default_llm_model_filename
|
429 |
update_llm_model_tupled_list()
|
430 |
return filename
|
|
|
454 |
return gr.update(value=format_name)
|
455 |
|
456 |
|
|
|
457 |
download_llm_model(default_llm_model_filename)
|
458 |
|
459 |
|
|
|
503 |
if not api.repo_exists(repo_id = repo) or not api.file_exists(repo_id = repo, filename = filename): return gr.update(visible=True)
|
504 |
add_models[filename] = [repo, format]
|
505 |
else: return gr.update(visible=True)
|
506 |
+
except Exception as e:
|
507 |
+
print(e)
|
508 |
return gr.update(visible=True)
|
509 |
+
#print(add_models)
|
510 |
llm_models = (llm_models | add_models).copy()
|
511 |
+
update_llm_model_tupled_list()
|
512 |
+
choices = get_dolphin_models()
|
513 |
+
return gr.update(choices=choices, value=choices[-1])
|
514 |
|
515 |
|
516 |
dolphin_output_language = "English"
|