import gradio as gr # Define a blue-themed CSS for the interface blue_theme_css = """ body {background-color: #e0f7fa;} /* Light blue background */ .gradio-app {color: #0d47a1;} /* Dark blue text for general elements */ .button {background-color: #42a5f5 !important;} /* Medium blue button */ .button:hover {background-color: #1e88e5 !important;} /* Darker blue on hover */ """ # Define the assistant prompt to provide context assistant_prompt = "you are se" # Define a function to interact with the model, taking input and adding context def assistant_response(user_input): # Here, you'd modify this to pass the assistant_prompt to your model API response = gr.load("models/meta-llama/Llama-3.2-3B-Instruct")(f"{assistant_prompt} {user_input}") return response # Create the Gradio Interface for the API app = gr.Interface( fn=assistant_response, inputs="text", outputs="text", css=blue_theme_css, title="Helpful Assistant API", description="Ask me anything, and I'll do my best to help!", examples=["What's the weather like today?", "Explain Python decorators."], allow_flagging="never" ) # Launch the app and make it API accessible app.launch(enable_queue=True, api_name="get_help")