import gradio as gr def house_saving(annual_salary, portion_saved, total_cost, portion_down_payment): if (annual_salary * portion_saved) / 12 > total_cost * portion_down_payment: return 1 else: months = (total_cost * portion_down_payment) / ((annual_salary * portion_saved) / 12) return round(months,0) demo = gr.Interface( fn=house_saving, inputs=[ gr.Number(value=4), "number", "number", "number" ], outputs="number", examples=[ [100, 0.1, 1000, 0.2], ], title="House Saving Time Calculator", description="heres a house saving time calculator, estimating the number of months it takes to pay the down payment for your dream house. Enjoy!" ) demo.launch()