jkorstad commited on
Commit
0065d29
·
verified ·
1 Parent(s): 498b8bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -5,6 +5,7 @@ import sys
5
  import tempfile
6
  import shutil
7
  import subprocess
 
8
  # from huggingface_hub import HfApi, snapshot_download # For future model management if needed
9
  # import spaces # For @spaces.GPU decorator if you add it
10
 
@@ -24,6 +25,7 @@ if DEVICE.type == 'cuda':
24
  else:
25
  print("Warning: CUDA not available or not detected by PyTorch. UniRig performance will be severely impacted.")
26
 
 
27
  def run_unirig_command(command_args, step_name):
28
  """Helper function to run UniRig commands using subprocess."""
29
  python_exe = sys.executable
@@ -60,9 +62,8 @@ def run_unirig_command(command_args, step_name):
60
  raise gr.Error(f"Unexpected Python error during {step_name}: {str(e_general)[:500]}")
61
 
62
 
63
- # If you are using @spaces.GPU, you would import it:
64
- # import spaces
65
  # @spaces.GPU # You can specify type like @spaces.GPU(type="t4") or count
 
66
  def rig_glb_mesh_multistep(input_glb_file_obj):
67
  """
68
  Takes an input GLB file object (from gr.File with type="filepath"),
 
5
  import tempfile
6
  import shutil
7
  import subprocess
8
+ import spaces
9
  # from huggingface_hub import HfApi, snapshot_download # For future model management if needed
10
  # import spaces # For @spaces.GPU decorator if you add it
11
 
 
25
  else:
26
  print("Warning: CUDA not available or not detected by PyTorch. UniRig performance will be severely impacted.")
27
 
28
+ @spaces.GPU
29
  def run_unirig_command(command_args, step_name):
30
  """Helper function to run UniRig commands using subprocess."""
31
  python_exe = sys.executable
 
62
  raise gr.Error(f"Unexpected Python error during {step_name}: {str(e_general)[:500]}")
63
 
64
 
 
 
65
  # @spaces.GPU # You can specify type like @spaces.GPU(type="t4") or count
66
+ @spaces.GPU
67
  def rig_glb_mesh_multistep(input_glb_file_obj):
68
  """
69
  Takes an input GLB file object (from gr.File with type="filepath"),