Spaces:
Runtime error
Runtime error
John Ho commited on
Commit ·
3eaf3ec
1
Parent(s): 4dc5aed
debugging internvl3
Browse files
app.py
CHANGED
|
@@ -214,10 +214,10 @@ def inference(
|
|
| 214 |
).to("cuda", dtype=DTYPE)
|
| 215 |
|
| 216 |
output = model.generate(**inputs, max_new_tokens=max_tokens)
|
| 217 |
-
logger.debug(output)
|
| 218 |
output_text = processor.decode(
|
| 219 |
output[0, inputs["input_ids"].shape[1] :], skip_special_tokens=True
|
| 220 |
)
|
|
|
|
| 221 |
case _:
|
| 222 |
raise ValueError(f"{model_name} is not currently supported")
|
| 223 |
return output_text
|
|
@@ -227,7 +227,12 @@ demo = gr.Interface(
|
|
| 227 |
fn=inference,
|
| 228 |
inputs=[
|
| 229 |
gr.Video(label="Input Video"),
|
| 230 |
-
gr.Textbox(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
gr.Dropdown(label="Model", choices=list(MODEL_ZOO.keys())),
|
| 232 |
gr.Number(
|
| 233 |
label="FPS",
|
|
|
|
| 214 |
).to("cuda", dtype=DTYPE)
|
| 215 |
|
| 216 |
output = model.generate(**inputs, max_new_tokens=max_tokens)
|
|
|
|
| 217 |
output_text = processor.decode(
|
| 218 |
output[0, inputs["input_ids"].shape[1] :], skip_special_tokens=True
|
| 219 |
)
|
| 220 |
+
logger.debug(output_text)
|
| 221 |
case _:
|
| 222 |
raise ValueError(f"{model_name} is not currently supported")
|
| 223 |
return output_text
|
|
|
|
| 227 |
fn=inference,
|
| 228 |
inputs=[
|
| 229 |
gr.Video(label="Input Video"),
|
| 230 |
+
gr.Textbox(
|
| 231 |
+
label="Prompt",
|
| 232 |
+
line=3,
|
| 233 |
+
info="[cam motion](https://huggingface.co/chancharikm/qwen2.5-vl-7b-cam-motion-preview)",
|
| 234 |
+
value="Describe the camera motion in this video.",
|
| 235 |
+
),
|
| 236 |
gr.Dropdown(label="Model", choices=list(MODEL_ZOO.keys())),
|
| 237 |
gr.Number(
|
| 238 |
label="FPS",
|