File size: 1,490 Bytes
e8e247e
081b46f
182a838
 
 
 
 
6f1af31
182a838
 
 
 
 
6f1af31
182a838
 
8fc7661
182a838
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import gradio as gr

# Function to display search results
def search(query, strategy):
    # Add your search logic here
    results = ["Result 1", "Result 2", "Result 3"]
    return "\n".join(results)

# Create a Gradio interface
def create_gradio_interface():
    # Top section with input text box and buttons
    input_box = gr.inputs.Textbox(label="Enter your search query:")
    default_options = gr.inputs.Radio(label="Default Options", choices=["Option 1", "Option 2", "Option 3"])

    # Section 1: Strategy 1
    strategy_1 = gr.inputs.CheckboxGroup(label="Strategy 1", choices=["ChatGPT", "LLaMA", "Vicuna", "Alpaca", "Flan-T"])

    # Section 2: Strategy 2
    strategy_2 = gr.inputs.CheckboxGroup(label="Strategy 2", choices=["ChatGPT", "LLaMA", "Vicuna", "Alpaca", "Flan-T5"])

    # Section 3: Strategy 3
    strategy_3 = gr.inputs.CheckboxGroup(label="Strategy 3", choices=["ChatGPT", "LLaMA", "Vicuna", "Alpaca", "Flan-T5"])

    # Define the interface layout
    interface = gr.Interface(
        fn=search,
        inputs=[input_box, default_options],
        outputs="text",
        layout=[
            [input_box, default_options],
            ["Section 1: Strategy 1", strategy_1],
            ["Section 2: Strategy 2", strategy_2],
            ["Section 3: Strategy 3", strategy_3]
        ],
        live=True,
        live_output=True
    )
    
    return interface

if __name__ == "__main__":
    gr_interface = create_gradio_interface()
    gr_interface.launch()