n0no123 commited on
Commit
e3108bd
1 Parent(s): 803b8fc

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 [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()
 
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()