test / python.py
ttttttt1111's picture
Upload 2 files
bc3da91 verified
Raw
History Blame Contribute Delete
465 Bytes
!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()