Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,6 +78,15 @@ EXAMPLES = [
|
|
| 78 |
]
|
| 79 |
# yapf:enable
|
| 80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
if not nncore.is_dir(BASE_MODEL):
|
| 82 |
snapshot_download(BASE_MODEL_REPO, local_dir=BASE_MODEL)
|
| 83 |
|
|
@@ -564,13 +573,14 @@ def build_demo():
|
|
| 564 |
chat = gr.Chatbot(
|
| 565 |
type='messages',
|
| 566 |
height='70em',
|
|
|
|
| 567 |
avatar_images=[f'{PATH}/assets/user.png', f'{PATH}/assets/bot.png'],
|
| 568 |
placeholder='A conversation with VideoMind',
|
| 569 |
label='VideoMind')
|
| 570 |
|
| 571 |
prompt = gr.Textbox(label='Text Prompt', placeholder='Ask a question about the video...')
|
| 572 |
|
| 573 |
-
with gr.Blocks(title=TITLE) as demo:
|
| 574 |
gr.HTML(LOGO)
|
| 575 |
gr.HTML(BADGE)
|
| 576 |
gr.Markdown(DISC)
|
|
@@ -585,7 +595,6 @@ def build_demo():
|
|
| 585 |
('📝 Answerer', 'ans')],
|
| 586 |
value=['pla', 'gnd', 'ver', 'ans'],
|
| 587 |
interactive=True,
|
| 588 |
-
elem_id='role',
|
| 589 |
label='Roles',
|
| 590 |
info='Select the role(s) you would like to activate.')
|
| 591 |
role.change(update_placeholder, role, prompt)
|
|
|
|
| 78 |
]
|
| 79 |
# yapf:enable
|
| 80 |
|
| 81 |
+
# https://github.com/gradio-app/gradio/pull/10552
|
| 82 |
+
JS = """
|
| 83 |
+
function init() {
|
| 84 |
+
if (window.innerWidth >= 1536) {
|
| 85 |
+
document.querySelector('main').style.maxWidth = '1536px'
|
| 86 |
+
}
|
| 87 |
+
}
|
| 88 |
+
"""
|
| 89 |
+
|
| 90 |
if not nncore.is_dir(BASE_MODEL):
|
| 91 |
snapshot_download(BASE_MODEL_REPO, local_dir=BASE_MODEL)
|
| 92 |
|
|
|
|
| 573 |
chat = gr.Chatbot(
|
| 574 |
type='messages',
|
| 575 |
height='70em',
|
| 576 |
+
resizable=True,
|
| 577 |
avatar_images=[f'{PATH}/assets/user.png', f'{PATH}/assets/bot.png'],
|
| 578 |
placeholder='A conversation with VideoMind',
|
| 579 |
label='VideoMind')
|
| 580 |
|
| 581 |
prompt = gr.Textbox(label='Text Prompt', placeholder='Ask a question about the video...')
|
| 582 |
|
| 583 |
+
with gr.Blocks(title=TITLE, js=JS) as demo:
|
| 584 |
gr.HTML(LOGO)
|
| 585 |
gr.HTML(BADGE)
|
| 586 |
gr.Markdown(DISC)
|
|
|
|
| 595 |
('📝 Answerer', 'ans')],
|
| 596 |
value=['pla', 'gnd', 'ver', 'ans'],
|
| 597 |
interactive=True,
|
|
|
|
| 598 |
label='Roles',
|
| 599 |
info='Select the role(s) you would like to activate.')
|
| 600 |
role.change(update_placeholder, role, prompt)
|