File size: 613 Bytes
4db3813
c37fa6e
4db3813
c37fa6e
42d83db
 
 
 
 
 
 
 
 
 
 
835295e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pickle
import gradio as gr

description = "input a single number or numbers separated with comma"
with open('final_model.pkl','rb') as g:
    model = pickle.load(g)
def grad(value):
    values = value.split(',')
    values = [int(i) for i in values]
    output = list(model.predict(values)['NOx'])
    output = [str(i) for i in output]
    output = "\n".join(output)
    return output


gr.Interface(grad, gr.Textbox(label = 'Months'),gr.Textbox(label = "NOx pollution values(microgram/m³"), description = description, title = "Predicting NOx pollution levels for station Avda. Ramón y Cajal" ).launch()