vineyard03/Code-Repair-With-LLMs
0
1import gradio as gr2import os3import utils.interface_utils as iutils4from components.chat import create_chat_controls5from components.bug_finding import create_bug_finding_tab6from components.pattern_matching import create_pattern_matching_tab7from components.patch_generation import create_patch_generation_tab8from components.patch_validation import create_patch_validation_tab9from components.file_upload import create_file_upload_section10 11def create_interface():12 # TODO: Replace with actual choices13 choices = ["ChatGPT", "Claude"]14 15 with gr.Blocks(theme=iutils.custom_theme(), css=iutils.custom_css()) as interface:16 with gr.Column():17 # Header with Logo18 with gr.Row():19 gr.Markdown("# Code Repair with LLMs") 20 gr.Markdown("") # Filler to push logo to the right21 gr.Image("logo.png", label="Logo", show_download_button=False, show_fullscreen_button=False, show_label=False, height=250, width=450, container=False)22 23 # Tabs for Different Features24 with gr.Tab("Chat"):25 create_bug_finding_tab(choices)26 27 with gr.Tab("Bug Finding"):28 create_bug_finding_tab(choices)29 30 with gr.Tab("Pattern Matching"):31 create_pattern_matching_tab(choices)32 33 with gr.Tab("Patch Generation"):34 create_patch_generation_tab(choices)35 36 with gr.Tab("Patch Validation"):37 create_patch_validation_tab(choices)38 39 # Chatbot Always at the Bottom40 with gr.Column():41 chatbot = gr.Chatbot(value=None, type="messages", show_label=True, show_share_button=False)42 create_chat_controls()43 44 return interface45 