Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,31 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
# Define custom CSS for a pastel gradient
|
4 |
+
css = """
|
5 |
+
.gradio-container {
|
6 |
+
background: linear-gradient(to right, #FFDEE9, #B5FFFC);
|
7 |
+
}
|
8 |
+
"""
|
9 |
|
10 |
+
def respond(message):
|
11 |
+
# Simple example function returning a response
|
12 |
+
return f"Vous avez dit: {message}"
|
13 |
+
|
14 |
+
with gr.Blocks(css=css) as demo:
|
15 |
+
# Display the greeting message
|
16 |
+
gr.Markdown(
|
17 |
+
"<h1 style='text-align: center;'>Bonjour Dans le chat du consentement</h1>"
|
18 |
+
)
|
19 |
+
|
20 |
+
# Create a simple text input and output
|
21 |
+
with gr.Row():
|
22 |
+
user_input = gr.Textbox(label="Entrez votre message ici")
|
23 |
+
btn = gr.Button("Envoyer")
|
24 |
+
output = gr.Textbox(label="Réponse")
|
25 |
+
|
26 |
+
# Link the button to the respond function
|
27 |
+
btn.click(fn=respond, inputs=user_input, outputs=output)
|
28 |
+
|
29 |
+
# Launch the app
|
30 |
+
if __name__ == "__main__":
|
31 |
+
demo.launch()
|