File size: 1,289 Bytes
42f8c86
d4b8781
42f8c86
2a7ee55
 
 
 
 
42f8c86
760d544
5638308
760d544
2a7ee55
7d03cc7
2a7ee55
 
 
760d544
 
7c9d88c
 
760d544
 
42f8c86
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import gradio as gr
from main import main_fn

#Input structure
##Postal_,age_,town_,storey_,room_ = 680705, 30, 'CHOA CHU KANG', 12, '5 ROOM'

town_list = ['ANG MO KIO', 'BEDOK', 'BISHAN', 'BUKIT BATOK', 'BUKIT MERAH', 'BUKIT PANJANG', 'BUKIT TIMAH', 'CENTRAL AREA', 'CHOA CHU KANG', 'CLEMENTI', 'GEYLANG', 'HOUGANG', 'JURONG EAST', 'JURONG WEST', 'KALLANG/WHAMPOA', 'MARINE PARADE', 'PASIR RIS', 'PUNGGOL', 'QUEENSTOWN', 'SEMBAWANG', 'SENGKANG', 'SERANGOON', 'TAMPINES', 'TOA PAYOH', 'WOODLANDS', 'YISHUN']
room_list = ['1 ROOM', '2 ROOM', '3 ROOM', '4 ROOM', '5 ROOM', 'EXECUTIVE', 'MULTI-GENERATION']

iface = gr.Interface(
    fn=main_fn, 
    inputs= [
            gr.inputs.Number(default=680705, label='Postal Code'),
            gr.inputs.Number(default=25, label='Years since lease commencement (TOP)'),
            gr.inputs.Dropdown(choices=town_list, type="value", default=None, label='Town'),
            gr.inputs.Number(default=11, label='Floor'),
            gr.inputs.Dropdown(choices=room_list, type="value", default=None, label='Room')
        ], 
    outputs= [
            gr.Textbox(type="text", label='Predicted House Price ($)'),
            gr.Dataframe(row_count = (10, "dynamic"), col_count=(4, "fixed"), label="Past transactions")
        ]
    )
iface.launch()