import gradio as gr theme = gr.themes.Soft() query_examples=[ ("Default Option 1"), ("Default Option 2"), ("Default Option 3") ] # Define a function that echoes the input text def echo_text(input_text): return input_text with gr.Interface( fn=echo_text, inputs=gr.Textbox(placeholder="Enter text here..."), outputs=gr.Textbox(), examples=query_examples, live=True, title="LLM Evaluator with Linguistic Scrutiny", theme=theme ) as iface: blocks = gr.Blocks() with gr.Row(): vicuna_model_selector = gr.Dropdown(["7b", "13b", "33b"], label="Vicuna Model", placeholder="Select model size") llama_model_selector = gr.Dropdown(["7B", "13B", "30B", "65B"], label="LLaMa Model", placeholder="Select model size") chatgpt_api_key = gr.Textbox(label="ChatGPT API Key", type="password", placeholder="Enter your API key") # Strategy 1 - QA-Based Prompting with gr.Accordion("Strategy 1 - QA-Based Prompting", style="font-weight: bold; font-size: 16px;"): with gr.Row(): chatgpt_btn = gr.Button("ChatGPT") llama_btn = gr.Button("LLaMA") vicuna_btn = gr.Button("Vicuna") alpaca_btn = gr.Button("Alpaca") flant5_btn = gr.Button("Flan-T5") # Strategy 2 - Instruction-Based Prompting with gr.Accordion("Strategy 2 - Instruction-Based Prompting", style="font-weight: bold; font-size: 16px;"): with gr.Row(): chatgpt_btn = gr.Button("ChatGPT") llama_btn = gr.Button("LLaMA") vicuna_btn = gr.Button("Vicuna") alpaca_btn = gr.Button("Alpaca") flant5_btn = gr.Button("Flan-T5") # Strategy 3 - Structured Prompting with gr.Accordion("Strategy 3 - Structured Prompting", style="font-weight: bold; font-size: 16px;"): with gr.Row(): chatgpt_btn = gr.Button("ChatGPT") llama_btn = gr.Button("LLaMA") vicuna_btn = gr.Button("Vicuna") alpaca_btn = gr.Button("Alpaca") flant5_btn = gr.Button("Flan-T5") iface.launch()