diff --git a/.gitignore b/.gitignore index 93b0c51..34af516 100644 --- a/.gitignore +++ b/.gitignore @@ -151,3 +151,4 @@ crazy_functions/test_samples request_llm/jittorllms !prompt_users/.keep prompt_users/* +.__test.py diff --git a/__main__.py b/__main__.py index 8f30ed7..03668af 100644 --- a/__main__.py +++ b/__main__.py @@ -187,8 +187,12 @@ class ChatBot(ChatBotFrame): crazy_fns[k]["Button"] = gr.Button(k, variant=self.variant) crazy_fns[k]["Button"].style(size="sm") with gr.Accordion("更多函数插件/高级用法", open=False): - dropdown_fn_list = [k for k in crazy_fns.keys() if - not crazy_fns[k].get("AsButton", True)] + dropdown_fn_list = [] + for k in crazy_fns.keys(): + if not crazy_fns[k].get("AsButton", True): + dropdown_fn_list.append(k) + elif crazy_fns[k].get('AdvancedArgs', False): + dropdown_fn_list.append(k) self.dropdown = gr.Dropdown(dropdown_fn_list, value=r"打开插件列表", label="").style( container=False) self.plugin_advanced_arg = gr.Textbox(show_label=True, label="高级参数输入区", visible=False, @@ -217,7 +221,7 @@ class ChatBot(ChatBotFrame): # temp = gr.Markdown(self.description) def draw_goals_auto(self): - with gr.Tab('Ai Prompt--未完成的作品--敬请期待---'): + with gr.Tab('Ai Prompt--未完成--敬请期待'): with gr.Row(): self.ai_name = gr.Textbox(show_label=False, placeholder="给Ai一个名字").style(container=False) with gr.Row(): diff --git a/test.py b/test.py deleted file mode 100644 index 3594dea..0000000 --- a/test.py +++ /dev/null @@ -1,115 +0,0 @@ -#! .\venv\ -# encoding: utf-8 -# @Time : 2023/4/19 -# @Author : Spike -# @Descr : -import gradio as gr - -import func_box - - -class my_class(): - - def __init__(self): - self.numb = 0 - - def coun_up(self): - self.numb += 1 - - -def set_obj(sts): - btn = sts['btn'].update(visible=False) - btn2 = sts['btn2'].update(visible=True) - sts['obj'] = my_class() - return sts, btn, btn2 - - -def print_obj(sts): - print(sts) - print(sts['btn'], type(sts['btn'])) - sts['obj'].coun_up() - print(sts['obj'].numb) - -class ChatBotFrame: - - def __init__(self): - self.cancel_handles = [] - self.initial_prompt = "Serve me as a writing and programming assistant." - self.title_html = f"