import gradio as gr def calculator(num1, operation, num2): if operation == "thêm vào": return num1 + num2 elif operation == "trừ đi": return num1 - num2 elif operation == "nhân": return num1 * num2 elif operation == "chia": return num1 / num2 demo = gr.Interface( fn=calculator, inputs=[ gr.Number(value=2), gr.Radio(["thêm vào", "trừ đi","nhân","chia"]), "number" ], outputs="number", examples=[ ], title="Mạnh Cường cậu bé thông minh", description="Máy tính. thêm vào. trừ. nhân" ) demo.launch(debug=True)