Repository navigation
Commit 3eb8e27
authored
Import torchcodec lazily in processing_utils (#50325)
The module-level import loaded torchcodec (and its FFmpeg libs) for every
processor, and could break importing processing_utils when torchcodec is
installed but not importable. Import it only in the audio-from-video path,
after the version check, which now raises ImportError.1 parent fd3cf01 commit 3eb8e27
1 file changed
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
| |||
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | 80 | | |
85 | 81 | | |
86 | 82 | | |
| |||
2571 | 2567 | | |
2572 | 2568 | | |
2573 | 2569 | | |
2574 | | - | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
2575 | 2574 | | |
2576 | 2575 | | |
2577 | 2576 | | |
| |||
2584 | 2583 | | |
2585 | 2584 | | |
2586 | 2585 | | |
2587 | | - | |
| 2586 | + | |
2588 | 2587 | | |
2589 | 2588 | | |
2590 | 2589 | | |
| |||
0 commit comments