daffaaditya commited on
Commit
486ba3c
Β·
verified Β·
1 Parent(s): 16b65d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +57 -26
app.py CHANGED
@@ -158,21 +158,55 @@ def create_interface():
158
  ["Buat file Sass untuk buttons"],
159
  ]
160
 
161
- # CSS sederhana
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
- # Header
171
- gr.Markdown("""
172
- # 🎯 Jekyll Master AI
173
- **Fine-tuned AI untuk Jekyll Static Site Generator**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
 
175
- Generate clean, production-ready code untuk website Jekyll Anda.
 
 
 
 
 
 
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
- text,
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.Markdown("---")
246
- gr.Markdown(f"""
247
- **Model:** [{MODEL_ID}](https://huggingface.co/{MODEL_ID}) |
248
- **Dataset:** [Jekyll Master Dataset](https://huggingface.co/datasets/daffaaditya/jekyll-master-dataset) |
249
- **Built with:** Transformers + Gradio
 
 
 
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 ============