import gradio as gr
import joblib

Tải mô hình từ Hugging Face Hub

model = joblib.load("sgd_model.pkl")

def predict(input1, input2, input3, input4):
input_data = [input1, input2, input3, input4]
return model.predict([input_data])[0] # Giả sử mô hình trả về 0 hoặc 1

interface = gr.Interface(
fn=predict,
inputs=["number", "number", "number", "number"],
outputs="label"
)

interface.launch()

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment