Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,7 @@ import gc
|
|
| 10 |
import yaml
|
| 11 |
import glob
|
| 12 |
from huggingface_hub import hf_hub_download
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
from decoder import SketchDecoder
|
|
@@ -229,6 +230,7 @@ def generate_svg(input_ids, attention_mask, pixel_values=None, image_grid_thw=No
|
|
| 229 |
traceback.print_exc()
|
| 230 |
return f"Error: {e}", None
|
| 231 |
|
|
|
|
| 232 |
def gradio_image_to_svg(image):
|
| 233 |
"""Gradio interface function - image-to-svg"""
|
| 234 |
if image is None:
|
|
@@ -249,6 +251,7 @@ def gradio_image_to_svg(image):
|
|
| 249 |
if os.path.exists(tmp_path):
|
| 250 |
os.unlink(tmp_path)
|
| 251 |
|
|
|
|
| 252 |
def gradio_text_to_svg(text_description):
|
| 253 |
"""Gradio interface function - text-to-svg"""
|
| 254 |
if not text_description or text_description.strip() == "":
|
|
|
|
| 10 |
import yaml
|
| 11 |
import glob
|
| 12 |
from huggingface_hub import hf_hub_download
|
| 13 |
+
import spaces
|
| 14 |
|
| 15 |
|
| 16 |
from decoder import SketchDecoder
|
|
|
|
| 230 |
traceback.print_exc()
|
| 231 |
return f"Error: {e}", None
|
| 232 |
|
| 233 |
+
@spaces.GPU(duration=75)
|
| 234 |
def gradio_image_to_svg(image):
|
| 235 |
"""Gradio interface function - image-to-svg"""
|
| 236 |
if image is None:
|
|
|
|
| 251 |
if os.path.exists(tmp_path):
|
| 252 |
os.unlink(tmp_path)
|
| 253 |
|
| 254 |
+
@spaces.GPU(duration=75)
|
| 255 |
def gradio_text_to_svg(text_description):
|
| 256 |
"""Gradio interface function - text-to-svg"""
|
| 257 |
if not text_description or text_description.strip() == "":
|