|
import gradio as gr |
|
import joblib |
|
import numpy as np |
|
import pandas as pd |
|
from huggingface_hub import hf_hub_download |
|
|
|
model = joblib.load( |
|
hf_hub_download("Skreeauk/dark-gbf-xgboost2", "model.joblib") |
|
) |
|
|
|
def predict(*features) -> str: |
|
|
|
columns = ['pns','seraph','opus','draconic','null_foe','off_ele'] |
|
data = pd.DataFrame([features], columns=columns) |
|
result = model.predict(data).tolist()[0] |
|
|
|
return result |
|
|
|
demo = gr.Interface( |
|
fn=predict, |
|
inputs=[gr.Slider(minimum=0, maximum=2, step=1, label="PnS"), |
|
gr.Checkbox(label='Seraph', info="True or False"), |
|
gr.Checkbox(label='Opus', info="True or False"), |
|
gr.Checkbox(label='Draconic', info="True or False"), |
|
gr.Checkbox(label='Null Ele Foe', info="True or False"), |
|
gr.Checkbox(label='Off Ele Foe', info="True or False")], |
|
outputs="text" |
|
) |
|
|
|
demo.launch() |