Spaces:
Running
Running
Commit
·
88900ab
1
Parent(s):
63fa8cc
Experimental UI v1
Browse files- gradio_app.py +78 -34
gradio_app.py
CHANGED
@@ -3,85 +3,129 @@ from model.analyzer import analyze_content
|
|
3 |
import asyncio
|
4 |
import time
|
5 |
|
6 |
-
# Custom CSS for
|
7 |
custom_css = """
|
8 |
.gradio-container {
|
9 |
-
background:
|
|
|
|
|
|
|
10 |
}
|
11 |
|
12 |
.treat-title {
|
13 |
text-align: center;
|
14 |
-
padding:
|
15 |
-
margin-bottom:
|
16 |
-
background: rgba(
|
17 |
border-radius: 15px;
|
18 |
-
box-shadow: 0 4px
|
|
|
19 |
}
|
20 |
|
21 |
.treat-title h1 {
|
22 |
-
font-size:
|
23 |
-
color: #
|
24 |
margin-bottom: 10px;
|
25 |
font-weight: bold;
|
|
|
26 |
}
|
27 |
|
28 |
.treat-title p {
|
29 |
-
font-size: 1.
|
30 |
-
color: #
|
|
|
31 |
}
|
32 |
|
33 |
.highlight {
|
34 |
-
color: #
|
35 |
font-weight: bold;
|
36 |
}
|
37 |
|
38 |
.content-area, .results-area {
|
39 |
-
background: rgba(
|
40 |
border-radius: 15px !important;
|
41 |
-
padding:
|
42 |
margin: 20px 0 !important;
|
43 |
-
box-shadow: 0
|
|
|
|
|
44 |
}
|
45 |
|
46 |
-
/* Input/Output styling */
|
47 |
.gradio-textbox textarea {
|
48 |
-
background-color:
|
49 |
-
color: #
|
50 |
-
border: 1px solid #
|
51 |
border-radius: 8px !important;
|
52 |
-
padding:
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
55 |
.gradio-button {
|
56 |
-
background-color: #
|
57 |
color: white !important;
|
58 |
border: none !important;
|
59 |
border-radius: 25px !important;
|
60 |
-
padding:
|
61 |
-
font-size: 1.
|
62 |
-
transition: transform 0.
|
63 |
-
margin:
|
64 |
}
|
65 |
|
66 |
.gradio-button:hover {
|
67 |
-
transform: scale(1.
|
68 |
-
background-color: #
|
|
|
|
|
|
|
|
|
|
|
69 |
}
|
70 |
|
71 |
-
/* Label styling */
|
72 |
label {
|
73 |
-
color: #
|
74 |
font-weight: 500 !important;
|
75 |
-
margin-bottom:
|
76 |
}
|
77 |
|
78 |
-
/* Center alignment for button */
|
79 |
.center-row {
|
80 |
display: flex;
|
81 |
justify-content: center;
|
82 |
align-items: center;
|
83 |
}
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
"""
|
86 |
|
87 |
def analyze_with_loading(text, progress=gr.Progress()):
|
@@ -137,7 +181,8 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as iface:
|
|
137 |
input_text = gr.Textbox(
|
138 |
label="Content to Analyze",
|
139 |
placeholder="Paste your content here...",
|
140 |
-
lines=8
|
|
|
141 |
)
|
142 |
|
143 |
# Button section
|
@@ -164,14 +209,13 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as iface:
|
|
164 |
api_name="analyze"
|
165 |
)
|
166 |
|
|
|
167 |
gr.HTML("""
|
168 |
-
<div class="footer"
|
169 |
<p>Made with 💖 by Kuber Mehta</p>
|
170 |
</div>
|
171 |
""")
|
172 |
|
173 |
-
|
174 |
-
|
175 |
if __name__ == "__main__":
|
176 |
# Launch without the 'ssr' argument
|
177 |
iface.launch(
|
|
|
3 |
import asyncio
|
4 |
import time
|
5 |
|
6 |
+
# Custom CSS for dark theme and modern animations
|
7 |
custom_css = """
|
8 |
.gradio-container {
|
9 |
+
background: #121212 !important;
|
10 |
+
color: #fff !important;
|
11 |
+
overflow: hidden;
|
12 |
+
transition: background 0.5s ease;
|
13 |
}
|
14 |
|
15 |
.treat-title {
|
16 |
text-align: center;
|
17 |
+
padding: 30px;
|
18 |
+
margin-bottom: 30px;
|
19 |
+
background: rgba(18, 18, 18, 0.85);
|
20 |
border-radius: 15px;
|
21 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
|
22 |
+
animation: slideInFromTop 1s ease-out;
|
23 |
}
|
24 |
|
25 |
.treat-title h1 {
|
26 |
+
font-size: 3.5em;
|
27 |
+
color: #ffa726;
|
28 |
margin-bottom: 10px;
|
29 |
font-weight: bold;
|
30 |
+
animation: fadeInText 1.5s ease-out;
|
31 |
}
|
32 |
|
33 |
.treat-title p {
|
34 |
+
font-size: 1.3em;
|
35 |
+
color: #ff7043;
|
36 |
+
animation: fadeInText 1.5s ease-out 0.5s;
|
37 |
}
|
38 |
|
39 |
.highlight {
|
40 |
+
color: #ffa726;
|
41 |
font-weight: bold;
|
42 |
}
|
43 |
|
44 |
.content-area, .results-area {
|
45 |
+
background: rgba(33, 33, 33, 0.9) !important;
|
46 |
border-radius: 15px !important;
|
47 |
+
padding: 30px !important;
|
48 |
margin: 20px 0 !important;
|
49 |
+
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5) !important;
|
50 |
+
opacity: 0;
|
51 |
+
animation: fadeInUp 1s forwards;
|
52 |
}
|
53 |
|
|
|
54 |
.gradio-textbox textarea {
|
55 |
+
background-color: #333 !important;
|
56 |
+
color: #fff !important;
|
57 |
+
border: 1px solid #444 !important;
|
58 |
border-radius: 8px !important;
|
59 |
+
padding: 12px !important;
|
60 |
+
font-size: 1.1em !important;
|
61 |
+
transition: border-color 0.3s ease;
|
62 |
+
}
|
63 |
+
|
64 |
+
.gradio-textbox textarea:focus {
|
65 |
+
border-color: #ffa726 !important;
|
66 |
}
|
67 |
|
68 |
.gradio-button {
|
69 |
+
background-color: #ff7043 !important;
|
70 |
color: white !important;
|
71 |
border: none !important;
|
72 |
border-radius: 25px !important;
|
73 |
+
padding: 12px 24px !important;
|
74 |
+
font-size: 1.2em !important;
|
75 |
+
transition: transform 0.3s ease, background-color 0.3s ease;
|
76 |
+
margin: 20px 0 !important;
|
77 |
}
|
78 |
|
79 |
.gradio-button:hover {
|
80 |
+
transform: scale(1.1) !important;
|
81 |
+
background-color: #ffa726 !important;
|
82 |
+
}
|
83 |
+
|
84 |
+
.gradio-button:active {
|
85 |
+
transform: scale(0.98) !important;
|
86 |
+
background-color: #fb8c00 !important;
|
87 |
}
|
88 |
|
|
|
89 |
label {
|
90 |
+
color: #ccc !important;
|
91 |
font-weight: 500 !important;
|
92 |
+
margin-bottom: 10px !important;
|
93 |
}
|
94 |
|
|
|
95 |
.center-row {
|
96 |
display: flex;
|
97 |
justify-content: center;
|
98 |
align-items: center;
|
99 |
}
|
100 |
|
101 |
+
.footer {
|
102 |
+
text-align: center;
|
103 |
+
margin-top: 40px;
|
104 |
+
font-size: 1.2em;
|
105 |
+
color: #bdbdbd;
|
106 |
+
opacity: 0;
|
107 |
+
animation: fadeInUp 1s forwards 1.5s;
|
108 |
+
}
|
109 |
+
|
110 |
+
.footer p {
|
111 |
+
color: #ffa726;
|
112 |
+
}
|
113 |
+
|
114 |
+
@keyframes slideInFromTop {
|
115 |
+
0% { transform: translateY(-50px); opacity: 0; }
|
116 |
+
100% { transform: translateY(0); opacity: 1; }
|
117 |
+
}
|
118 |
+
|
119 |
+
@keyframes fadeInText {
|
120 |
+
0% { opacity: 0; }
|
121 |
+
100% { opacity: 1; }
|
122 |
+
}
|
123 |
+
|
124 |
+
@keyframes fadeInUp {
|
125 |
+
0% { opacity: 0; transform: translateY(30px); }
|
126 |
+
100% { opacity: 1; transform: translateY(0); }
|
127 |
+
}
|
128 |
+
|
129 |
"""
|
130 |
|
131 |
def analyze_with_loading(text, progress=gr.Progress()):
|
|
|
181 |
input_text = gr.Textbox(
|
182 |
label="Content to Analyze",
|
183 |
placeholder="Paste your content here...",
|
184 |
+
lines=8,
|
185 |
+
interactive=True
|
186 |
)
|
187 |
|
188 |
# Button section
|
|
|
209 |
api_name="analyze"
|
210 |
)
|
211 |
|
212 |
+
# Footer section
|
213 |
gr.HTML("""
|
214 |
+
<div class="footer">
|
215 |
<p>Made with 💖 by Kuber Mehta</p>
|
216 |
</div>
|
217 |
""")
|
218 |
|
|
|
|
|
219 |
if __name__ == "__main__":
|
220 |
# Launch without the 'ssr' argument
|
221 |
iface.launch(
|