File size: 693 Bytes
8a4966f d13438a 8a4966f d13438a 8a4966f d13438a 8a4966f d13438a 8a4966f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
import gradio as gr
import numpy as np
from PIL import Image
import requests
import hopsworks
import joblib
project = hopsworks.login(api_key_value="0rdWXlLgEd3mkGOg.iRZ7TtAkWGPlJHNQcAEph6Qbokoaq7QTBRI9ckwWUki8tIYGyBvrKhJvtLoUOGQ4")
fs = project.get_feature_store()
mr = project.get_model_registry()
model = mr.get_model("xgboost_model", version=1)
model_dir = model.download()
model = joblib.load(model_dir + "/model.pkl")
def forecast():
x = 0
#res = model.predict(x)
return 10
demo = gr.Interface(
fn=titanic,
title="Air Quality Prediction",
description="Get aqi value",
allow_flagging="never",
outputs=gr.Textbox(label="Result: "))
demo.launch() |