File size: 1,111 Bytes
8a4966f
 
 
 
 
 
 
 
 
 
 
 
d13438a
4a4c69a
 
8a4966f
 
d13438a
 
199fe41
 
 
 
 
 
 
d13438a
 
 
8a4966f
 
f31f0f6
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
32
33
34
35
36
37
38
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
    # input_list = [ 0.        , 24        , -0.68645433, -0.06804887, -0.31264014,
    #    -0.13749569, -0.32063957, -0.2942814 , -0.18460245, -0.41253886,
    #     0.06395449,  0.71276574, -0.36466156, -1.03879548, -0.65985627,
    #     0        ,  0        ,  0.12254366,  0.39172671,  0.34205118,
    #     0.21383452, -1.0216134 ,  0.40277851, -0.34577169, -0.36832646,
    #    -0.7210296 ,  0        ]

    #res = model.predict(x)
    
    return 10

demo = gr.Interface(
    fn=forecast,
    title="Air Quality Prediction",
    description="Get aqi value",
    allow_flagging="never",
    outputs=gr.Textbox(label="Result: "))

demo.launch()