import gradio as gr def generate_data(subject, input_field, difficulty): # Traiter les données ici, par exemple imprimer les données print("Sujet:", subject) print("Input:", input_field) print("Difficulté:", difficulty) q = """When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$""" return q # Créer l'interface utilisateur Gradio # Créer l'interface utilisateur avec les composants créés interface = gr.Interface( fn=generate_data, inputs=[gr.Textbox(), gr.Textbox(), gr.Textbox()] , outputs=gr.Textbox(), title="Génération de données", theme="light" ) # Lancer l'interface utilisateur interface.launch()