Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -3,6 +3,11 @@ os.environ.setdefault("PYTORCH_CUDA_ALLOC_CONF", "expandable_segments:True")
|
|
| 3 |
|
| 4 |
import spaces # MUST come before any torch/CUDA-touching import
|
| 5 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
import gradio as gr
|
| 7 |
import numpy as np
|
| 8 |
import tempfile
|
|
|
|
| 3 |
|
| 4 |
import spaces # MUST come before any torch/CUDA-touching import
|
| 5 |
import torch
|
| 6 |
+
import torchvision
|
| 7 |
+
# Compatibility shim: torchvision >= 0.21 removed functional_tensor, which pytorchvideo still imports
|
| 8 |
+
if not hasattr(torchvision.transforms, 'functional_tensor'):
|
| 9 |
+
import torchvision.transforms.functional as _F
|
| 10 |
+
torchvision.transforms.functional_tensor = _F
|
| 11 |
import gradio as gr
|
| 12 |
import numpy as np
|
| 13 |
import tempfile
|