Csplk commited on
Commit
5f847d3
1 Parent(s): c626b12

Update app.py

Browse files

Add free GPU hardware support if space hardware is changed to zeroGPU from current free CPU hardware. https://huggingface.co/zero-gpu-explorers

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,5 +1,5 @@
1
  from os.path import basename, splitext
2
-
3
  import gradio as gr
4
  from huggingface_hub import hf_hub_download
5
 
@@ -8,7 +8,7 @@ from onnx_inference import vectorize_image
8
 
9
  MODEL_PATH = hf_hub_download("nopperl/marked-lineart-vectorizer", "model.onnx")
10
 
11
-
12
  def predict(input_image_path, threshold, stroke_width):
13
  output_filepath = splitext(basename(input_image_path))[0] + ".svg"
14
  for recons_img in vectorize_image(input_image_path, model=MODEL_PATH, output=output_filepath, threshold_ratio=threshold, stroke_width=stroke_width):
 
1
  from os.path import basename, splitext
2
+ import spaces
3
  import gradio as gr
4
  from huggingface_hub import hf_hub_download
5
 
 
8
 
9
  MODEL_PATH = hf_hub_download("nopperl/marked-lineart-vectorizer", "model.onnx")
10
 
11
+ @spaces.GPU
12
  def predict(input_image_path, threshold, stroke_width):
13
  output_filepath = splitext(basename(input_image_path))[0] + ".svg"
14
  for recons_img in vectorize_image(input_image_path, model=MODEL_PATH, output=output_filepath, threshold_ratio=threshold, stroke_width=stroke_width):