multimodalart HF Staff commited on
Commit
73159e5
·
verified ·
1 Parent(s): 966ec4e

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -119,7 +119,7 @@ CSS = """
119
  .dark .gradio-container { color: var(--body-text-color); }
120
  """
121
 
122
- with gr.Blocks(theme=gr.themes.Citrus(), css=CSS) as demo:
123
  with gr.Column(elem_id="col-container"):
124
  gr.Markdown(
125
  """
@@ -149,19 +149,20 @@ with gr.Blocks(theme=gr.themes.Citrus(), css=CSS) as demo:
149
  minimum=64, maximum=2048, value=512, step=64,
150
  label="Max new tokens",
151
  )
152
- run_btn.click(
153
- analyze,
154
- inputs=[video_in, question_in, max_new_tokens],
155
- outputs=answer_out,
156
- api_name="analyze",
157
- )
158
  with gr.Column(scale=1):
159
  answer_out = gr.Textbox(
160
  label="Analysis",
161
  lines=14,
162
- show_copy_button=True,
163
  )
164
 
 
 
 
 
 
 
 
165
  gr.Examples(
166
  examples=[
167
  ["examples/sim_microwave_spoon.mp4",
@@ -181,4 +182,4 @@ with gr.Blocks(theme=gr.themes.Citrus(), css=CSS) as demo:
181
  label="Try the authors' test questions (from the RoboFAC dataset)",
182
  )
183
 
184
- demo.launch(mcp_server=True)
 
119
  .dark .gradio-container { color: var(--body-text-color); }
120
  """
121
 
122
+ with gr.Blocks() as demo:
123
  with gr.Column(elem_id="col-container"):
124
  gr.Markdown(
125
  """
 
149
  minimum=64, maximum=2048, value=512, step=64,
150
  label="Max new tokens",
151
  )
 
 
 
 
 
 
152
  with gr.Column(scale=1):
153
  answer_out = gr.Textbox(
154
  label="Analysis",
155
  lines=14,
156
+ buttons=["copy"],
157
  )
158
 
159
+ run_btn.click(
160
+ analyze,
161
+ inputs=[video_in, question_in, max_new_tokens],
162
+ outputs=answer_out,
163
+ api_name="analyze",
164
+ )
165
+
166
  gr.Examples(
167
  examples=[
168
  ["examples/sim_microwave_spoon.mp4",
 
182
  label="Try the authors' test questions (from the RoboFAC dataset)",
183
  )
184
 
185
+ demo.launch(mcp_server=True, theme=gr.themes.Citrus(), css=CSS)