Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -158,21 +158,55 @@ def create_interface():
|
|
| 158 |
["Buat file Sass untuk buttons"],
|
| 159 |
]
|
| 160 |
|
| 161 |
-
|
| 162 |
-
css = """
|
| 163 |
-
.gradio-container { max-width: 1200px; margin: 0 auto; }
|
| 164 |
-
.header { text-align: center; padding: 20px; }
|
| 165 |
-
.example-btn { margin: 5px; }
|
| 166 |
-
"""
|
| 167 |
-
|
| 168 |
-
with gr.Blocks(css=css, title="Jekyll Master AI") as demo:
|
| 169 |
|
| 170 |
-
#
|
| 171 |
-
gr.
|
| 172 |
-
|
| 173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
|
| 175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
""")
|
| 177 |
|
| 178 |
with gr.Row():
|
|
@@ -222,14 +256,8 @@ def create_interface():
|
|
| 222 |
("π¨ Layout", "Buat layout post"),
|
| 223 |
("π§ Plugin", "Buat plugin Jekyll"),
|
| 224 |
]:
|
| 225 |
-
gr.Button(
|
| 226 |
-
|
| 227 |
-
size="sm",
|
| 228 |
-
variant="secondary"
|
| 229 |
-
).click(
|
| 230 |
-
lambda ex=example: ex,
|
| 231 |
-
outputs=instruction
|
| 232 |
-
)
|
| 233 |
|
| 234 |
# Full examples
|
| 235 |
gr.Examples(
|
|
@@ -242,11 +270,14 @@ def create_interface():
|
|
| 242 |
)
|
| 243 |
|
| 244 |
# Footer
|
| 245 |
-
gr.
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
|
|
|
|
|
|
|
|
|
| 250 |
""")
|
| 251 |
|
| 252 |
# ============ EVENT HANDLERS ============
|
|
|
|
| 158 |
["Buat file Sass untuk buttons"],
|
| 159 |
]
|
| 160 |
|
| 161 |
+
with gr.Blocks(title="Jekyll Master AI") as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
+
# Custom CSS via HTML element
|
| 164 |
+
gr.HTML("""
|
| 165 |
+
<style>
|
| 166 |
+
.gradio-container {
|
| 167 |
+
max-width: 1200px;
|
| 168 |
+
margin: 0 auto;
|
| 169 |
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
|
| 170 |
+
}
|
| 171 |
+
.header {
|
| 172 |
+
text-align: center;
|
| 173 |
+
padding: 20px;
|
| 174 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 175 |
+
color: white;
|
| 176 |
+
border-radius: 10px;
|
| 177 |
+
margin-bottom: 20px;
|
| 178 |
+
}
|
| 179 |
+
.example-btn {
|
| 180 |
+
margin: 5px;
|
| 181 |
+
}
|
| 182 |
+
.footer {
|
| 183 |
+
text-align: center;
|
| 184 |
+
margin-top: 30px;
|
| 185 |
+
padding-top: 20px;
|
| 186 |
+
border-top: 1px solid #eee;
|
| 187 |
+
color: #666;
|
| 188 |
+
}
|
| 189 |
+
.gradio-button {
|
| 190 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 191 |
+
color: white;
|
| 192 |
+
border: none;
|
| 193 |
+
}
|
| 194 |
+
.gradio-button:hover {
|
| 195 |
+
opacity: 0.9;
|
| 196 |
+
}
|
| 197 |
+
textarea, input {
|
| 198 |
+
border-radius: 8px !important;
|
| 199 |
+
}
|
| 200 |
+
</style>
|
| 201 |
+
""")
|
| 202 |
|
| 203 |
+
# Header
|
| 204 |
+
gr.HTML("""
|
| 205 |
+
<div class="header">
|
| 206 |
+
<h1 style="margin: 0">π― Jekyll Master AI</h1>
|
| 207 |
+
<p style="font-size: 1.2em; opacity: 0.9">Fine-tuned AI untuk Jekyll Static Site Generator</p>
|
| 208 |
+
<p>Generate clean, production-ready code untuk website Jekyll Anda.</p>
|
| 209 |
+
</div>
|
| 210 |
""")
|
| 211 |
|
| 212 |
with gr.Row():
|
|
|
|
| 256 |
("π¨ Layout", "Buat layout post"),
|
| 257 |
("π§ Plugin", "Buat plugin Jekyll"),
|
| 258 |
]:
|
| 259 |
+
btn = gr.Button(text, size="sm")
|
| 260 |
+
btn.click(lambda ex=example: ex, outputs=instruction)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 261 |
|
| 262 |
# Full examples
|
| 263 |
gr.Examples(
|
|
|
|
| 270 |
)
|
| 271 |
|
| 272 |
# Footer
|
| 273 |
+
gr.HTML(f"""
|
| 274 |
+
<div class="footer">
|
| 275 |
+
<p>
|
| 276 |
+
<strong>Model:</strong> <a href="https://huggingface.co/{MODEL_ID}" target="_blank">{MODEL_ID}</a> |
|
| 277 |
+
<strong>Dataset:</strong> <a href="https://huggingface.co/datasets/daffaaditya/jekyll-master-dataset" target="_blank">Jekyll Master Dataset</a> |
|
| 278 |
+
<strong>Built with:</strong> Transformers + Gradio
|
| 279 |
+
</p>
|
| 280 |
+
</div>
|
| 281 |
""")
|
| 282 |
|
| 283 |
# ============ EVENT HANDLERS ============
|