File size: 1,224 Bytes
d4ae3ad
 
52a6899
d4ae3ad
 
b136c8c
f177830
a340f90
d4ae3ad
 
 
 
 
 
49c0a90
 
ffca676
d4ae3ad
 
ffca676
b136c8c
d4ae3ad
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
import compare_kit
import pandas as pd


def analyse_ifc(file1, file2, token):
    result1, result2 = compare_kit.ChatIFC_multiple(file1.name, file2.name, token)
    return result1, result2


def main():
    input_file1 = gr.File(label="Please upload a json file")
    input_file2 = gr.File(label="Please upload a txt file")
    token = gr.Textbox(label="Please provide chat AI tokens (seperate by ';')")
    out_display = gr.Dataframe(label="Result table is below. Please wait several minutes", 
                               type="pandas", overflow_row_behaviour="show_ends")
    outp = gr.File(label="Please download the csv file here")

    demo = gr.Interface(fn = analyse_ifc, 
                        inputs = [input_file1, input_file2, token], 
                        outputs = [out_display, outp],
                        title = "ChatIFC",
                        description = """This is a localhost interface for checking whether the building has violated the regulations. \nYou can upload your ifc and law file to the left side. \nThe information will be output on the right side."""
                        )
    demo.launch()



if __name__ == '__main__':
    main()