Spaces:
Sleeping
Sleeping
updated
Browse files
app.py
CHANGED
@@ -32,60 +32,65 @@ def generate_text(prompt, max_length=150):
|
|
32 |
return generated_text
|
33 |
|
34 |
# Custom CSS for the UI
|
35 |
-
|
36 |
-
|
|
|
37 |
background: #A8C4D6;
|
38 |
-
}
|
39 |
/* Response message */
|
40 |
-
.message.bot.svelte-1s78gfg.message-bubble-border {
|
41 |
border-color: #266B99;
|
42 |
-
}
|
43 |
/* User message */
|
44 |
-
.message.user.svelte-1s78gfg.message-bubble-border {
|
45 |
background: #9DDDF9;
|
46 |
border-color: #9DDDF9;
|
47 |
-
}
|
48 |
/* For both user and response message as per the document */
|
49 |
-
span.md.svelte-8tpqd2.chatbot.prose p {
|
50 |
color: #266B99;
|
51 |
-
}
|
52 |
/* Chatbot container */
|
53 |
-
.gradio-container {
|
54 |
background: #1c1c1c; /* Dark background */
|
55 |
color: white; /* Light text color */
|
56 |
-
}
|
|
|
|
|
|
|
|
|
57 |
/* RED (Hex: #DB1616) for action buttons and links only */
|
58 |
-
.clear-btn {
|
59 |
background: #DB1616;
|
60 |
color: white;
|
61 |
-
}
|
62 |
/* Primary colors are set to be used for all sorts */
|
63 |
-
.submit-btn {
|
64 |
background: #266B99;
|
65 |
color: white;
|
66 |
-
}
|
67 |
/* Add icons to messages */
|
68 |
-
.message.user.svelte-1s78gfg {
|
69 |
display: flex;
|
70 |
align-items: center;
|
71 |
-
}
|
72 |
-
.message.user.svelte-1s78gfg:before {
|
73 |
content: url('file=Komal-patra/EU_AI_ACT/user icon.jpeg');
|
74 |
margin-right: 8px;
|
75 |
-
}
|
76 |
-
.message.bot.svelte-1s78gfg {
|
77 |
display: flex;
|
78 |
align-items: center;
|
79 |
-
}
|
80 |
-
.message.bot.svelte-1s78gfg:before {
|
81 |
content: url('file=Komal-patra/EU_AI_ACT/orcawise image.png');
|
82 |
margin-right: 8px;
|
83 |
-
}
|
84 |
/* Enable scrolling for the chatbot messages */
|
85 |
-
.chatbot .messages {
|
86 |
max-height: 500px; /* Adjust as needed */
|
87 |
overflow-y: auto;
|
88 |
-
}
|
89 |
"""
|
90 |
|
91 |
# Gradio interface setup
|
|
|
32 |
return generated_text
|
33 |
|
34 |
# Custom CSS for the UI
|
35 |
+
background_image_path = 'https://www.shlegal-technology.com/sites/default/files/insight/ExploringTheLegislativeBackgroundBANNER.jpg'
|
36 |
+
custom_css = f"""
|
37 |
+
.message.pending {{
|
38 |
background: #A8C4D6;
|
39 |
+
}}
|
40 |
/* Response message */
|
41 |
+
.message.bot.svelte-1s78gfg.message-bubble-border {{
|
42 |
border-color: #266B99;
|
43 |
+
}}
|
44 |
/* User message */
|
45 |
+
.message.user.svelte-1s78gfg.message-bubble-border {{
|
46 |
background: #9DDDF9;
|
47 |
border-color: #9DDDF9;
|
48 |
+
}}
|
49 |
/* For both user and response message as per the document */
|
50 |
+
span.md.svelte-8tpqd2.chatbot.prose p {{
|
51 |
color: #266B99;
|
52 |
+
}}
|
53 |
/* Chatbot container */
|
54 |
+
.gradio-container {{
|
55 |
background: #1c1c1c; /* Dark background */
|
56 |
color: white; /* Light text color */
|
57 |
+
background-image: url('{background_image_path}'); /* Add background image */
|
58 |
+
background-size: cover; /* Cover the entire container */
|
59 |
+
background-position: center; /* Center the image */
|
60 |
+
background-repeat: no-repeat; /* Do not repeat the image */
|
61 |
+
}}
|
62 |
/* RED (Hex: #DB1616) for action buttons and links only */
|
63 |
+
.clear-btn {{
|
64 |
background: #DB1616;
|
65 |
color: white;
|
66 |
+
}}
|
67 |
/* Primary colors are set to be used for all sorts */
|
68 |
+
.submit-btn {{
|
69 |
background: #266B99;
|
70 |
color: white;
|
71 |
+
}}
|
72 |
/* Add icons to messages */
|
73 |
+
.message.user.svelte-1s78gfg {{
|
74 |
display: flex;
|
75 |
align-items: center;
|
76 |
+
}}
|
77 |
+
.message.user.svelte-1s78gfg:before {{
|
78 |
content: url('file=Komal-patra/EU_AI_ACT/user icon.jpeg');
|
79 |
margin-right: 8px;
|
80 |
+
}}
|
81 |
+
.message.bot.svelte-1s78gfg {{
|
82 |
display: flex;
|
83 |
align-items: center;
|
84 |
+
}}
|
85 |
+
.message.bot.svelte-1s78gfg:before {{
|
86 |
content: url('file=Komal-patra/EU_AI_ACT/orcawise image.png');
|
87 |
margin-right: 8px;
|
88 |
+
}}
|
89 |
/* Enable scrolling for the chatbot messages */
|
90 |
+
.chatbot .messages {{
|
91 |
max-height: 500px; /* Adjust as needed */
|
92 |
overflow-y: auto;
|
93 |
+
}}
|
94 |
"""
|
95 |
|
96 |
# Gradio interface setup
|