Upload 2 files
Browse files- app.py +4 -0
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -10,6 +10,9 @@ from typing import Optional, Tuple, Dict, Any
|
|
| 10 |
from pathlib import Path
|
| 11 |
import traceback
|
| 12 |
|
|
|
|
|
|
|
|
|
|
| 13 |
import gradio as gr
|
| 14 |
import numpy as np
|
| 15 |
|
|
@@ -275,6 +278,7 @@ def create_interface():
|
|
| 275 |
logger.error(f"Script suggestion failed: {e}")
|
| 276 |
return "Back to '87 - the future is now!"
|
| 277 |
|
|
|
|
| 278 |
def generate_commercial(
|
| 279 |
brand_name: str,
|
| 280 |
structure_text: str,
|
|
|
|
| 10 |
from pathlib import Path
|
| 11 |
import traceback
|
| 12 |
|
| 13 |
+
# Initialize spaces GPU before any other imports
|
| 14 |
+
import spaces
|
| 15 |
+
|
| 16 |
import gradio as gr
|
| 17 |
import numpy as np
|
| 18 |
|
|
|
|
| 278 |
logger.error(f"Script suggestion failed: {e}")
|
| 279 |
return "Back to '87 - the future is now!"
|
| 280 |
|
| 281 |
+
@spaces.GPU
|
| 282 |
def generate_commercial(
|
| 283 |
brand_name: str,
|
| 284 |
structure_text: str,
|
requirements.txt
CHANGED
|
@@ -9,6 +9,7 @@ diffusers==0.31.0
|
|
| 9 |
safetensors==0.4.3
|
| 10 |
sentencepiece==0.2.0
|
| 11 |
huggingface_hub==0.24.6
|
|
|
|
| 12 |
|
| 13 |
# PyTorch ecosystem (already installed in base image)
|
| 14 |
# torch==2.4.0
|
|
|
|
| 9 |
safetensors==0.4.3
|
| 10 |
sentencepiece==0.2.0
|
| 11 |
huggingface_hub==0.24.6
|
| 12 |
+
spaces==0.42.0
|
| 13 |
|
| 14 |
# PyTorch ecosystem (already installed in base image)
|
| 15 |
# torch==2.4.0
|