Upload 2 files
Browse files- app.py +18 -0
- requirement.txt +1 -0
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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")
|
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 [home * 390, people * home * 131, bus * 36 * distance * 104]
|
15 |
+
|
16 |
+
|
17 |
+
gr.Interface(fn=my_app, inputs=[
|
18 |
+
home_input, people_input, bus_input, distance_input], outputs="text").launch()
|
requirement.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
gradio
|