ckmoraiz commited on
Commit
2791cb8
·
1 Parent(s): a9314ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import gradio as gr
2
  import numpy as np
3
  import pandas as pd
@@ -27,17 +28,16 @@ def infer(cylinder, bore, stroke, cooling):
27
  with gr.Blocks() as demo:
28
  bore = gr.Number(label="Bore size in mm:")
29
  stroke = gr.Number(label="Stroke size in mm:")
30
-
31
- engine_label = """
32
  Choose the number of engine configuration:\n
33
  [0]Diesel [1]Four cylinder boxer [2]In-line four\n
34
  [3]In-line six [4]In-line three [5]Single cylinder\n
35
  [6]Six cylinder boxer [7]Square four cylinder [8]Twin\n
36
  [9]Two cylinder boxer [10]V2 [11]V3\n
37
  [12]V4 [13]V6 [14]V8
38
- """
39
 
40
- cylinder = gr.Number(label=engine_label)
41
 
42
  gr.Markdown(
43
  """
@@ -48,7 +48,6 @@ with gr.Blocks() as demo:
48
 
49
  specs = [cylinder, bore, stroke, cooling]
50
  out = gr.Textbox()
51
-
52
 
53
- iface = gr.Interface(fn=infer, inputs=specs, outputs=out)
54
- iface.launch()
 
1
+ from logging import PlaceHolder
2
  import gradio as gr
3
  import numpy as np
4
  import pandas as pd
 
28
  with gr.Blocks() as demo:
29
  bore = gr.Number(label="Bore size in mm:")
30
  stroke = gr.Number(label="Stroke size in mm:")
31
+ gr.Markdown("""
 
32
  Choose the number of engine configuration:\n
33
  [0]Diesel [1]Four cylinder boxer [2]In-line four\n
34
  [3]In-line six [4]In-line three [5]Single cylinder\n
35
  [6]Six cylinder boxer [7]Square four cylinder [8]Twin\n
36
  [9]Two cylinder boxer [10]V2 [11]V3\n
37
  [12]V4 [13]V6 [14]V8
38
+ """)
39
 
40
+ cylinder = gr.Number(placeholder="Number of engine configuration")
41
 
42
  gr.Markdown(
43
  """
 
48
 
49
  specs = [cylinder, bore, stroke, cooling]
50
  out = gr.Textbox()
51
+ gr.Interface(fn=infer, inputs=specs, outputs=out)
52
 
53
+ demo.launch()