Spaces:
Running
Running
debug: space requirements
Browse files- app.py +20 -3
- requirements.txt +10 -9
app.py
CHANGED
|
@@ -1,10 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import torch
|
| 2 |
import gradio as gr
|
| 3 |
import spaces
|
| 4 |
from diffusers.utils import export_to_video
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Define model options
|
| 10 |
MODEL_OPTIONS = {
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
import subprocess
|
| 3 |
+
import importlib.util
|
| 4 |
+
|
| 5 |
+
# Check if required packages are installed
|
| 6 |
+
required_packages = ["ftfy", "einops", "imageio", "imageio-ffmpeg"]
|
| 7 |
+
for package in required_packages:
|
| 8 |
+
if importlib.util.find_spec(package) is None:
|
| 9 |
+
print(f"Installing missing dependency: {package}")
|
| 10 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
|
| 11 |
+
|
| 12 |
import torch
|
| 13 |
import gradio as gr
|
| 14 |
import spaces
|
| 15 |
from diffusers.utils import export_to_video
|
| 16 |
+
|
| 17 |
+
# Now try to import the specific components
|
| 18 |
+
try:
|
| 19 |
+
from diffusers import AutoencoderKLWan, WanPipeline
|
| 20 |
+
from diffusers.schedulers.scheduling_unipc_multistep import UniPCMultistepScheduler
|
| 21 |
+
from diffusers.schedulers.scheduling_flow_match_euler_discrete import FlowMatchEulerDiscreteScheduler
|
| 22 |
+
except ImportError as e:
|
| 23 |
+
print(f"Error importing diffusers components: {e}")
|
| 24 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "diffusers"])
|
| 25 |
|
| 26 |
# Define model options
|
| 27 |
MODEL_OPTIONS = {
|
requirements.txt
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
-
|
| 2 |
-
transformers
|
| 3 |
-
accelerate
|
| 4 |
-
safetensors
|
| 5 |
torch>=2.0.1
|
| 6 |
-
ftfy
|
| 7 |
-
einops
|
| 8 |
-
imageio
|
| 9 |
-
imageio-ffmpeg
|
| 10 |
-
opencv-python
|
|
|
|
|
|
| 1 |
+
diffusers==0.27.1
|
| 2 |
+
transformers>=4.36.0
|
| 3 |
+
accelerate>=0.27.2
|
| 4 |
+
safetensors>=0.4.1
|
| 5 |
torch>=2.0.1
|
| 6 |
+
ftfy>=6.1.3
|
| 7 |
+
einops>=0.7.0
|
| 8 |
+
imageio>=2.31.6
|
| 9 |
+
imageio-ffmpeg>=0.4.9
|
| 10 |
+
opencv-python>=4.9.0.0
|
| 11 |
+
omegaconf>=2.3.0
|