Upload app.py
Browse files
app.py
CHANGED
@@ -7,12 +7,12 @@ import gradio as gr
|
|
7 |
home_input = gr.inputs.Number(label="Number of homes in the city")
|
8 |
people_input = gr.inputs.Number(label="Average number of person by home")
|
9 |
bus_input = gr.inputs.Number(label="Number of bus in the city")
|
10 |
-
distance_input = gr.inputs.Number(label="Average distance by bus")
|
11 |
|
12 |
|
13 |
def my_app(home, people, bus, distance):
|
14 |
-
return
|
15 |
|
16 |
|
17 |
gr.Interface(fn=my_app, inputs=[
|
18 |
-
home_input, people_input, bus_input, distance_input], outputs="
|
|
|
7 |
home_input = gr.inputs.Number(label="Number of homes in the city")
|
8 |
people_input = gr.inputs.Number(label="Average number of person by home")
|
9 |
bus_input = gr.inputs.Number(label="Number of bus in the city")
|
10 |
+
distance_input = gr.inputs.Number(label="Average distance by bus each month")
|
11 |
|
12 |
|
13 |
def my_app(home, people, bus, distance):
|
14 |
+
return "Monthly electrical consumption: " + str(home * 390) + "kWh/month", "Monthly water consumption: " + str(people * home * 131) + "L/month", "Monthly CO2 emission: " + str(bus * 36 * distance * 104) + "g/km/month"
|
15 |
|
16 |
|
17 |
gr.Interface(fn=my_app, inputs=[
|
18 |
+
home_input, people_input, bus_input, distance_input], outputs=["number", "number", "number"]).launch()
|