ChatIFC / chatifc_interface.py
TakuKoh's picture
Update chatifc_interface.py
49c0a90
Raw
History Blame Contribute Delete
1.22 kB
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()