diff --git a/.gitignore b/.gitignore index 0dd68f8..06ed13d 100644 --- a/.gitignore +++ b/.gitignore @@ -146,4 +146,5 @@ debug* private* crazy_functions/test_project/pdf_and_word crazy_functions/test_samples -request_llm/jittorllms \ No newline at end of file +request_llm/jittorllms +request_llm/moss \ No newline at end of file diff --git a/core_functional.py b/core_functional.py index 536ccb6..e126b57 100644 --- a/core_functional.py +++ b/core_functional.py @@ -68,4 +68,11 @@ def get_core_functions(): "Prefix": r"请解释以下代码:" + "\n```\n", "Suffix": "\n```\n", }, + "参考文献转Bib": { + "Prefix": r"Here are some bibliography items, please transform them into bibtex style." + + r"Note that, reference styles maybe more than one kind, you should transform each item correctly." + + r"Items need to be transformed:", + "Suffix": r"", + "Visible": False, + } } diff --git a/main.py b/main.py index 4de8015..d9888f8 100644 --- a/main.py +++ b/main.py @@ -74,6 +74,7 @@ def main(): with gr.Accordion("基础功能区", open=True) as area_basic_fn: with gr.Row(): for k in functional: + if ("Visible" in functional[k]) and (not functional[k]["Visible"]): continue variant = functional[k]["Color"] if "Color" in functional[k] else "secondary" functional[k]["Button"] = gr.Button(k, variant=variant) with gr.Accordion("函数插件区", open=True) as area_crazy_fn: @@ -144,6 +145,7 @@ def main(): clearBtn2.click(lambda: ("",""), None, [txt, txt2]) # 基础功能区的回调函数注册 for k in functional: + if ("Visible" in functional[k]) and (not functional[k]["Visible"]): continue click_handle = functional[k]["Button"].click(fn=ArgsGeneralWrapper(predict), inputs=[*input_combo, gr.State(True), gr.State(k)], outputs=output_combo) cancel_handles.append(click_handle) # 文件上传区,接收文件后与chatbot的互动