File size: 465 Bytes
bc3da91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
!pip install -q gradio joblib

import gradio as gr
import joblib

# Load model
model = joblib.load("dbs.jl")

# Prediction function
def predict_dbs(x):
    pred = model.predict([[x]])
    pred = pred[0][0]
    return pred   # extract single value

# Gradio interface
demo = gr.Interface(
    fn=predict_dbs,
    inputs=gr.Number(label="Input value"),
    outputs=gr.Number(label="Prediction"),
    title="DBS Prediction App"
)

demo.launch()