import gradio as gr import subprocess from gradio.mix import Parallel def qa_prompting(model): # Call your `run_llm.py` script for QA-Based Prompting with the selected model output = subprocess.check_output([sys.executable, "run_llm.py", "--model", model, ...], text=True) return output def strategy_1_interface(): model_names = ["ChatGPT", "LLaMA", "Vicuna", "Alpaca", "Flan-T5"] interfaces = [] for model_name in model_names: interfaces.append(gr.Interface( fn=qa_prompting, inputs=gr.inputs.Textbox(label=f"{model_name} Input"), outputs=gr.outputs.Textbox(label=f"{model_name} Output"), title=f"Strategy 1 - QA-Based Prompting: {model_name}", )) return Parallel(*interfaces) if __name__ == "__main__": iface = strategy_1_interface() iface.launch()