jkorstad commited on
Commit
2b9f86c
·
verified ·
1 Parent(s): fd9d8fc

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
@@ -65,9 +67,8 @@ def run_unirig_command(command_args, step_name):
65
  raise gr.Error(f"Unexpected Python error during {step_name}: {str(e_general)[:500]}")
66
 
67
 
68
- # If you are using @spaces.GPU, you would import it:
69
- # import spaces
70
  # @spaces.GPU # You can specify type like @spaces.GPU(type="t4") or count
 
71
  def rig_glb_mesh_multistep(input_glb_file_obj):
72
  """
73
  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
 
67
  raise gr.Error(f"Unexpected Python error during {step_name}: {str(e_general)[:500]}")
68
 
69
 
 
 
70
  # @spaces.GPU # You can specify type like @spaces.GPU(type="t4") or count
71
+ @spaces.GPU
72
  def rig_glb_mesh_multistep(input_glb_file_obj):
73
  """
74
  Takes an input GLB file object (from gr.File with type="filepath"),