Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,20 +31,43 @@ sliders = [
|
|
| 31 |
gr.Slider(minimum=3.75, maximum=5.52, step=0.1, label="Elongation"),
|
| 32 |
gr.Slider(minimum=8.04, maximum=10.54, step=0.1, label="Elon_CV"),
|
| 33 |
]
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
gr.
|
| 37 |
-
gr.
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
# Create the interface
|
| 41 |
-
demo = gr.Interface(
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
)
|
| 48 |
|
| 49 |
if __name__ == "__main__":
|
| 50 |
demo.launch()
|
|
|
|
| 31 |
gr.Slider(minimum=3.75, maximum=5.52, step=0.1, label="Elongation"),
|
| 32 |
gr.Slider(minimum=8.04, maximum=10.54, step=0.1, label="Elon_CV"),
|
| 33 |
]
|
| 34 |
+
|
| 35 |
+
with gr.Blocks() as demo:
|
| 36 |
+
gr.Markdown("## RPM Prediction App")
|
| 37 |
+
gr.Markdown("Adjust sliders for 12 features to predict RPM using a Decision Tree Regressor.")
|
| 38 |
+
|
| 39 |
+
with gr.Row():
|
| 40 |
+
sliders_row1 = sliders[0:4]
|
| 41 |
+
for slider in sliders_row1:
|
| 42 |
+
slider.render()
|
| 43 |
+
|
| 44 |
+
with gr.Row():
|
| 45 |
+
sliders_row2 = sliders[4:8]
|
| 46 |
+
for slider in sliders_row2:
|
| 47 |
+
slider.render()
|
| 48 |
+
|
| 49 |
+
with gr.Row():
|
| 50 |
+
sliders_row3 = sliders[8:12]
|
| 51 |
+
for slider in sliders_row3:
|
| 52 |
+
slider.render()
|
| 53 |
+
|
| 54 |
+
output = gr.Number(label="Predicted RPM")
|
| 55 |
+
predict_btn = gr.Button("Predict RPM")
|
| 56 |
+
|
| 57 |
+
predict_btn.click(
|
| 58 |
+
fn=predict_rpm,
|
| 59 |
+
inputs=sliders,
|
| 60 |
+
outputs=output
|
| 61 |
+
)
|
| 62 |
+
|
| 63 |
# Create the interface
|
| 64 |
+
# demo = gr.Interface(
|
| 65 |
+
# fn=predict_rpm,
|
| 66 |
+
# inputs=sliders,
|
| 67 |
+
# outputs=gr.Number(label="Predicted RPM"),
|
| 68 |
+
# title="RPM Prediction App",
|
| 69 |
+
# description="Adjust the sliders for each of the 12 features to predict the RPM."
|
| 70 |
+
# )
|
| 71 |
|
| 72 |
if __name__ == "__main__":
|
| 73 |
demo.launch()
|