from inference import predict import gradio as gr # Function to call the FastAPI backend def predict(question1, question2, threshold): similarity, is_same = predict(question1, question2, threshold, verbose=True) return similarity, is_same # Launch the Gradio interface if __name__ == "__main__": gr.Interface(predict, inputs=[gr.Textbox(placeholder="Is Leonel Messi the Goat ?"), gr.Textbox(placeholder="Is Leonel Messi the best player ever?"), gr.Slider(minimum=0.0, maximum=1.0)], outputs=["number", "textbox"], description="This app tells us whether the two questions are similar or not" )