Spaces:
Running on Zero
Running on Zero
Commit ·
68273f5
1
Parent(s): c8ec0f7
Restore the .change() type: ignore removed during the develop merge
Browse filesmypy without gradio installed treats it as untyped Any (ignore_missing_imports),
which made the ignore comment look unused locally. CI installs gradio for real,
where the base Component type genuinely lacks .change(), so the suppression is
required there.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -509,7 +509,11 @@ with gr.Blocks() as demo:
|
|
| 509 |
|
| 510 |
preview_inputs = [input_image_component, duration_input, frame_multiplier_input, upscale_checkbox]
|
| 511 |
for component in preview_inputs:
|
| 512 |
-
component
|
|
|
|
|
|
|
|
|
|
|
|
|
| 513 |
demo.load(fn=preview_effect, inputs=preview_inputs, outputs=effect_preview)
|
| 514 |
|
| 515 |
if __name__ == "__main__":
|
|
|
|
| 509 |
|
| 510 |
preview_inputs = [input_image_component, duration_input, frame_multiplier_input, upscale_checkbox]
|
| 511 |
for component in preview_inputs:
|
| 512 |
+
# `component` collapses to the base Component type across this mixed list, and gradio's
|
| 513 |
+
# stubs only declare .change on the concrete subclasses, not the base.
|
| 514 |
+
component.change( # type: ignore[attr-defined]
|
| 515 |
+
fn=preview_effect, inputs=preview_inputs, outputs=effect_preview
|
| 516 |
+
)
|
| 517 |
demo.load(fn=preview_effect, inputs=preview_inputs, outputs=effect_preview)
|
| 518 |
|
| 519 |
if __name__ == "__main__":
|