harrim-nv commited on
Commit
2329017
·
verified ·
1 Parent(s): 0f1eaf3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -22
app.py CHANGED
@@ -290,36 +290,36 @@ with gr.Blocks(title="Cosmos-Reason1", theme=gr.themes.Soft()) as demo:
290
  outputs=[output, status]
291
  )
292
 
293
- # Example data:
294
- example_data = [
295
  [
296
- "group_in_park.jpg", # Replace with your actual image path or URL
297
  "What is happening in this image?"
298
  ]
299
  ]
300
 
301
- # Add examples section to the interface
302
- example_component = gr.Examples(
303
- examples=example_data,
 
 
 
 
 
 
 
 
304
  inputs=[image_input, text_input],
305
- label="Examples"
 
306
  )
307
 
308
- # Auto-submit when an example is clicked
309
- example_component.dataset.click(
310
- fn=process_input,
311
- inputs=[
312
- image_input,
313
- video_input,
314
- text_input,
315
- temperature,
316
- top_p,
317
- repetition_penalty,
318
- max_tokens,
319
- role_selector,
320
- custom_role_text
321
- ],
322
- outputs=[output, status]
323
  )
324
 
325
  if __name__ == "__main__":
 
290
  outputs=[output, status]
291
  )
292
 
293
+ # Example for image
294
+ image_examples = [
295
  [
296
+ "group_in_park.jpg",
297
  "What is happening in this image?"
298
  ]
299
  ]
300
 
301
+ # Example for video
302
+ video_examples = [
303
+ [
304
+ "car_curb_video.mp4",
305
+ "What is wrong in this video?"
306
+ ]
307
+ ]
308
+
309
+ # Image example block
310
+ gr.Examples(
311
+ examples=image_examples,
312
  inputs=[image_input, text_input],
313
+ label="Image Example: click to load then hit Submit",
314
+ cache_examples="lazy"
315
  )
316
 
317
+ # Video example block
318
+ gr.Examples(
319
+ examples=video_examples,
320
+ inputs=[video_input, text_input],
321
+ label="Video Exammple: click to load then hit Submit",
322
+ cache_examples="lazy"
 
 
 
 
 
 
 
 
 
323
  )
324
 
325
  if __name__ == "__main__":