Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -290,5 +290,39 @@ with gr.Blocks(title="Cosmos-Reason1", theme=gr.themes.Soft()) as demo:
|
|
290 |
outputs=[output, status]
|
291 |
)
|
292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
if __name__ == "__main__":
|
294 |
demo.launch()
|
|
|
290 |
outputs=[output, status]
|
291 |
)
|
292 |
|
293 |
+
# Example data: (image_path, video_path, question, temperature, top_p, repetition_penalty, max_tokens, role, custom_role_text)
|
294 |
+
example_data = [
|
295 |
+
[
|
296 |
+
"group_in_park.jpg", # Replace with your actual image file path
|
297 |
+
None, # No video in this example
|
298 |
+
"What is happening in this image?",
|
299 |
+
0.6, # temperature
|
300 |
+
0.95, # top_p
|
301 |
+
1.05, # repetition_penalty
|
302 |
+
4096, # max_tokens
|
303 |
+
"General Assistant",
|
304 |
+
ROLES["Custom Role"]
|
305 |
+
]
|
306 |
+
]
|
307 |
+
|
308 |
+
# Add examples section to the interface
|
309 |
+
gr.Examples(
|
310 |
+
examples=example_data,
|
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 |
+
fn=process_input,
|
324 |
+
cache_examples="lazy"
|
325 |
+
)
|
326 |
+
|
327 |
if __name__ == "__main__":
|
328 |
demo.launch()
|