File size: 593 Bytes
4db3813
 
 
42d83db
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pickle
import gradio

description = "input a single number or numbers seperated 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"), description = description, title = "Predicting NOx pollution levels for station Avda. Ramón y Cajal" ).launch()