| import gradio as gr | |
| def predict(x): | |
| w = 0.5 | |
| b = 2 | |
| return w * x + b | |
| interface = gr.Interface( | |
| fn=predict, | |
| inputs="number", | |
| outputs="number", | |
| title="Basic Linear Regression", | |
| description="Enter a value and predict the output based on the linear equation.", | |
| ) | |
| interface.launch() |