MCPcopy Create free account
hub / github.com/Yuan-Li-FNLP/R3-RAG / create_basic

Function create_basic

tool/FlashRAG/webui/components/basic.py:7–58  ·  view source on GitHub ↗
(engine: "Engine")

Source from the content-addressed store, hash-verified

5import gradio as gr
6
7def create_basic(engine: "Engine") -> Dict[str, "Component"]:
8 with gr.Row():
9 lang = gr.Dropdown(
10 choices = ["zh", "en"],
11 )
12
13 method_name = gr.Dropdown(
14 choices = METHODS,
15 value = METHODS[0],
16 interactive = True
17 )
18
19 config_file = gr.Dropdown(
20 choices = engine.runner.get_config_files(),
21 value = None,
22 interactive = True
23 )
24
25 with gr.Accordion(open = True) as base_tab:
26 with gr.Row():
27 gpu_id = gr.Textbox(interactive = True, placeholder = "0,1,2,3,4,5,6,7,8")
28 framework = gr.Dropdown(
29 choices = ["hf", "vllm", 'fschat', 'openai'],
30 value = 'hf',
31 interactive = True
32 )
33
34 generator_name = gr.Textbox(interactive = True, placeholder = 'llama3.1-8b-instruct')
35 generator_model_path = gr.Textbox(interactive = True, placeholder = 'meta-llama/Llama-3.1-8B-Instruct')
36
37 with gr.Row():
38 retrieval_method = gr.Textbox(interactive = True, placeholder = 'e5')
39 retrieval_model_path = gr.Textbox(interactive = True, placeholder = 'intfloat/e5-base-v2')
40
41 with gr.Row():
42 corpus_path = gr.Textbox(interactive = True)
43 index_path = gr.Textbox(interactive = True)
44
45 return dict(
46 lang = lang,
47 method_name = method_name,
48 gpu_id = gpu_id,
49 base_tab = base_tab,
50 framework = framework,
51 generator_name = generator_name,
52 generator_model_path = generator_model_path,
53 retrieval_method = retrieval_method,
54 retrieval_model_path = retrieval_model_path,
55 corpus_path = corpus_path,
56 index_path = index_path,
57 config_file = config_file
58 )
59
60

Callers 1

create_uiFunction · 0.90

Calls 1

get_config_filesMethod · 0.80

Tested by

no test coverage detected