import gradio as gr def estimate_ac_capacity(length, width, height): # Volume of the room in cubic feet volume = length * width * height # Rule of thumb: 20 BTU per square foot or 0.133 BTU per cubic foot btu = volume * 0.133 # You can adjust this factor for more precision tons = btu / 12000 # 1 ton = 12,000 BTU/hr return f"Estimated AC Capacity: {btu:.0f} BTU/hr ({tons:.2f} tons)" demo = gr.Interface( fn=estimate_ac_capacity, inputs=[ gr.Number(label="Length (feet)"), gr.Number(label="Width (feet)"), gr.Number(label="Height (feet)") ], outputs="text", title="AC Capacity Estimator", description="Enter the room dimensions to estimate the air conditioning capacity needed." ) demo.launch()