Upload app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,3 @@
|
|
1 |
-
# nb de foyers dans la ville * 390 (kWh) = month consommation
|
2 |
-
# nb moyen de personnes par foyer * nb de foyers * 131 (L) = water consumption
|
3 |
-
# 36 (places bus) * 104 (g/km) * moyenne des distances parcourues par des bus.
|
4 |
-
|
5 |
import gradio as gr
|
6 |
|
7 |
home_input = gr.inputs.Number(label="Number of homes in the city")
|
@@ -11,7 +7,7 @@ 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/
|
15 |
|
16 |
|
17 |
gr.Interface(fn=my_app, inputs=[
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
home_input = gr.inputs.Number(label="Number of homes in the city")
|
|
|
7 |
|
8 |
|
9 |
def my_app(home, people, bus, distance):
|
10 |
+
return "Monthly electrical consumption: " + str(home * 390) + " kWh/mo", "Monthly water consumption: " + str(people * home * 131) + " L/mo", "Monthly CO2 emission: " + str(bus * 36 * distance * 104) + " g/km/mo"
|
11 |
|
12 |
|
13 |
gr.Interface(fn=my_app, inputs=[
|