Spaces:
Paused
Paused
Commit
·
231932e
1
Parent(s):
2fa4732
Add spaces GPU decorator for Hugging Face deployment
Browse files- Added spaces package to requirements.txt
- Imported spaces module in app.py
- Decorated generate_interpolation with @spaces.GPU
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- app.py +2 -0
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -2,6 +2,7 @@ import os
|
|
| 2 |
import tempfile
|
| 3 |
|
| 4 |
import gradio as gr
|
|
|
|
| 5 |
import torch
|
| 6 |
from diffusers.utils import export_to_video
|
| 7 |
from PIL import Image
|
|
@@ -38,6 +39,7 @@ def load_model(model_path):
|
|
| 38 |
return "✓ Model loaded successfully!"
|
| 39 |
|
| 40 |
|
|
|
|
| 41 |
def generate_interpolation(
|
| 42 |
first_image,
|
| 43 |
last_image,
|
|
|
|
| 2 |
import tempfile
|
| 3 |
|
| 4 |
import gradio as gr
|
| 5 |
+
import spaces
|
| 6 |
import torch
|
| 7 |
from diffusers.utils import export_to_video
|
| 8 |
from PIL import Image
|
|
|
|
| 39 |
return "✓ Model loaded successfully!"
|
| 40 |
|
| 41 |
|
| 42 |
+
@spaces.GPU
|
| 43 |
def generate_interpolation(
|
| 44 |
first_image,
|
| 45 |
last_image,
|
requirements.txt
CHANGED
|
@@ -3,4 +3,5 @@ transformers==4.44.2
|
|
| 3 |
accelerate==0.34.0
|
| 4 |
torch>=2.0.0
|
| 5 |
torchvision
|
| 6 |
-
Pillow
|
|
|
|
|
|
| 3 |
accelerate==0.34.0
|
| 4 |
torch>=2.0.0
|
| 5 |
torchvision
|
| 6 |
+
Pillow
|
| 7 |
+
spaces
|