gmonsoon commited on
Commit
75bc521
·
verified ·
1 Parent(s): b98b5a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -85
app.py CHANGED
@@ -201,7 +201,7 @@ def run(message: dict, history: list[dict], system_prompt: str = "", max_new_tok
201
  examples = [
202
  [
203
  {
204
- "text": "I need to be in Japan for 10 days, going to Tokyo, Kyoto and Osaka. Think about number of attractions in each of them and allocate number of days to each city. Make public transport recommendations.",
205
  "files": [],
206
  }
207
  ],
@@ -211,12 +211,6 @@ examples = [
211
  "files": ["assets/additional-examples/barchart.png"],
212
  }
213
  ],
214
- [
215
- {
216
- "text": "What is odd about this video?",
217
- "files": ["assets/additional-examples/tmp.mp4"],
218
- }
219
- ],
220
  [
221
  {
222
  "text": "I already have this supplement <image> and I want to buy this one <image>. Any warnings I should know about?",
@@ -225,97 +219,32 @@ examples = [
225
  ],
226
  [
227
  {
228
- "text": "Write a poem inspired by the visual elements of the images.",
229
- "files": ["assets/sample-images/06-1.png", "assets/sample-images/06-2.png"],
230
- }
231
- ],
232
- [
233
- {
234
- "text": "Compose a short musical piece inspired by the visual elements of the images.",
235
- "files": [
236
- "assets/sample-images/07-1.png",
237
- "assets/sample-images/07-2.png",
238
- "assets/sample-images/07-3.png",
239
- "assets/sample-images/07-4.png",
240
- ],
241
- }
242
- ],
243
- [
244
- {
245
- "text": "Write a short story about what might have happened in this house.",
246
- "files": ["assets/sample-images/08.png"],
247
- }
248
- ],
249
- [
250
- {
251
- "text": "Create a short story based on the sequence of images.",
252
- "files": [
253
- "assets/sample-images/09-1.png",
254
- "assets/sample-images/09-2.png",
255
- "assets/sample-images/09-3.png",
256
- "assets/sample-images/09-4.png",
257
- "assets/sample-images/09-5.png",
258
- ],
259
- }
260
- ],
261
- [
262
- {
263
- "text": "Describe the creatures that would live in this world.",
264
- "files": ["assets/sample-images/10.png"],
265
- }
266
- ],
267
- [
268
- {
269
- "text": "Read text in the image.",
270
- "files": ["assets/additional-examples/1.png"],
271
- }
272
- ],
273
- [
274
- {
275
- "text": "When is this ticket dated and how much did it cost?",
276
- "files": ["assets/additional-examples/2.png"],
277
- }
278
- ],
279
- [
280
- {
281
- "text": "Read the text in the image into markdown.",
282
- "files": ["assets/additional-examples/3.png"],
283
- }
284
- ],
285
- [
286
- {
287
- "text": "Evaluate this integral.",
288
- "files": ["assets/additional-examples/4.png"],
289
- }
290
- ],
291
- [
292
- {
293
- "text": "caption this image",
294
- "files": ["assets/sample-images/01.png"],
295
  }
296
  ],
297
  [
298
  {
299
- "text": "What's the sign says?",
300
- "files": ["assets/sample-images/02.png"],
301
  }
302
  ],
303
  [
304
  {
305
- "text": "Compare and contrast the two images.",
306
- "files": ["assets/sample-images/03.png"],
307
  }
308
  ],
309
  [
310
  {
311
- "text": "List all the objects in the image and their colors.",
312
- "files": ["assets/sample-images/04.png"],
313
  }
314
  ],
315
  [
316
  {
317
- "text": "Describe the atmosphere of the scene.",
318
- "files": ["assets/sample-images/05.png"],
319
  }
320
  ],
321
  ]
@@ -323,8 +252,6 @@ examples = [
323
  DESCRIPTION = """\
324
  <img src='https://huggingface.co/spaces/huggingface-projects/gemma-3-12b-it/resolve/main/assets/logo.png' id='logo' />
325
 
326
- This is a demo of Gemma 3 12B it, a vision language model with outstanding performance on a wide range of tasks.
327
- You can upload images, interleaved images and videos. Note that video input only supports single-turn conversation and mp4 input.
328
  """
329
 
330
  demo = gr.ChatInterface(
@@ -338,7 +265,7 @@ demo = gr.ChatInterface(
338
  gr.Slider(label="Max New Tokens", minimum=100, maximum=2000, step=10, value=700),
339
  ],
340
  stop_btn=False,
341
- title="Gemma 3 12B IT",
342
  description=DESCRIPTION,
343
  examples=examples,
344
  run_examples_on_click=False,
 
201
  examples = [
202
  [
203
  {
204
+ "text": "Saya perlu berada di Jepang selama 10 hari, untuk pergi ke Tokyo, Kyoto, dan Osaka. Pertimbangkan jumlah tempat wisata di masing-masing kota dan alokasikan jumlah hari untuk setiap kota. Berikan juga rekomendasi transportasi umum.",
205
  "files": [],
206
  }
207
  ],
 
211
  "files": ["assets/additional-examples/barchart.png"],
212
  }
213
  ],
 
 
 
 
 
 
214
  [
215
  {
216
  "text": "I already have this supplement <image> and I want to buy this one <image>. Any warnings I should know about?",
 
219
  ],
220
  [
221
  {
222
+ "text": "Bagaimana pajak karbon dapat berfungsi untuk mengurangi emisi?",
223
+ "files": [],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  }
225
  ],
226
  [
227
  {
228
+ "text": "Mengapa tarif FIT yang diindeks berdasarkan biaya produksi PLN dapat menghambat pengembangan energi terbarukan di wilayah seperti Jawa?",
229
+ "files": [],
230
  }
231
  ],
232
  [
233
  {
234
+ "text": "Jelaskan apa saja yang dimaksud dengan Energi Baru Terbarukan, dan apa saja potensi EBT di Indonesia",
235
+ "files": [],
236
  }
237
  ],
238
  [
239
  {
240
+ "text": "Berapa target capaian EBT di Indonesia?",
241
+ "files": [],
242
  }
243
  ],
244
  [
245
  {
246
+ "text": "Apa saja pilar utama dalam Kebijakan Energi Nasional menurut PP 79/2014?",
247
+ "files": [],
248
  }
249
  ],
250
  ]
 
252
  DESCRIPTION = """\
253
  <img src='https://huggingface.co/spaces/huggingface-projects/gemma-3-12b-it/resolve/main/assets/logo.png' id='logo' />
254
 
 
 
255
  """
256
 
257
  demo = gr.ChatInterface(
 
265
  gr.Slider(label="Max New Tokens", minimum=100, maximum=2000, step=10, value=700),
266
  ],
267
  stop_btn=False,
268
+ title="Gemma 3 - Indonesia Energy Transition (DEMO)",
269
  description=DESCRIPTION,
270
  examples=examples,
271
  run_examples_on_click=False,