import gradio as gr from app_functions import Get_DialoGPT_Response, Get_DistilGPT_Response, Get_MedGPT_Response # Custom CSS for styling (optional) custom_css = """ body { background-color: #121212; color: #E0E0E0; font-family: 'Poppins', sans-serif; } .gradio-container { width: 70%; margin: 0 auto; padding: 20px; } h1 { color: #FF6347; font-size: 50px; text-align: center; font-weight: bold; } h3 { color: #FF6347; text-align: center; } textarea, input, select { background-color: #1E1E2F; color: #E0E0E0; border: 1px solid #3D3D5C; border-radius: 6px; padding: 10px; font-size: 14px; } button { background-color: #007BFF; color: white; font-size: 16px; font-weight: bold; padding: 10px; border-radius: 6px; border: none; cursor: pointer; transition: all 0.3s; width: 50%; margin: 0 auto; } button:hover { background-color: #0056b3; } .response-box { background-color: #1E1E2F; padding: 15px; border-radius: 6px; color: #E0E0E0; font-size: 16px; min-height: 100px; text-align: left; } """ # Define the generate_response function def generate_response(input_text, no_words, user_type, model_type): if model_type == "DialoGPT": return Get_DialoGPT_Response(input_text, no_words, user_type) elif model_type == "DistilGPT": return Get_DistilGPT_Response(input_text, no_words, user_type) elif model_type == "MedGPT": return Get_MedGPT_Response(input_text, no_words, user_type) else: return "Invalid model type selected." # Build Gradio interface with gr.Blocks(css=custom_css) as interface: gr.Markdown("