BladeSzaSza commited on
Commit
8b356ed
Β·
1 Parent(s): 48809ea

feat: Update Hunyuan3D setup and dependencies

Browse files

- Removed explicit torch installation in model_3d_generator.py as it's handled by requirements.
- Added --no-build-isolation to pip install commands for Hunyuan3D dependencies.
- Updated gradio version in requirements.txt.

Files changed (2) hide show
  1. models/model_3d_generator.py +9 -9
  2. requirements.txt +1 -1
models/model_3d_generator.py CHANGED
@@ -110,9 +110,9 @@ class Hunyuan3DGenerator:
110
  )
111
  logger.info(f"βœ… Model repository downloaded to: {self.model_path}")
112
 
113
- # List the contents of the downloaded directory for debugging
114
- logger.info(f"πŸ” Listing contents of {self.model_path}...")
115
- run_setup_command(['ls', '-R'], cwd=self.model_path)
116
 
117
  # --- Installation and Compilation ---
118
  logger.info("πŸ”§ Running Hunyuan3D setup scripts with detailed logging...")
@@ -121,24 +121,24 @@ class Hunyuan3DGenerator:
121
  requirements_path = os.path.join(self.model_path, 'requirements_hunyuan3d.txt')
122
  if os.path.exists(requirements_path):
123
  pip_command = [
124
- sys.executable, '-m', 'pip', 'install', '-r', requirements_path,
125
  '--extra-index-url', 'https://mirrors.cloud.tencent.com/pypi/simple/',
126
  '--extra-index-url', 'https://mirrors.aliyun.com/pypi/simple'
127
  ]
128
  run_setup_command(pip_command, cwd=self.model_path)
129
 
130
  # 2. Install custom rasterizer dependencies (torch)
131
- logger.info("Installing torch, torchvision, torchaudio...")
132
- pip_command_torch = [sys.executable, '-m', 'pip', 'install', 'torch==2.5.1', 'torchvision==0.20.1', 'torchaudio==2.5.1', '--index-url', 'https://download.pytorch.org/whl/cu124']
133
- run_setup_command(pip_command_torch, cwd=self.model_path)
134
 
135
  # 3. Install custom rasterizer
136
  rasterizer_path = os.path.join(self.model_path, 'hy3dpaint', 'packages', 'custom_rasterizer')
137
  if os.path.exists(rasterizer_path):
138
- pip_command_rasterizer = [sys.executable, '-m', 'pip', 'install', '-e', '.']
139
  run_setup_command(pip_command_rasterizer, cwd=rasterizer_path)
140
 
141
- # 3. Compile mesh painter
142
  renderer_path = os.path.join(self.model_path, 'hy3dpaint', 'DifferentiableRenderer')
143
  compile_script_path = os.path.join(renderer_path, 'compile_mesh_painter.sh')
144
  if os.path.exists(compile_script_path):
 
110
  )
111
  logger.info(f"βœ… Model repository downloaded to: {self.model_path}")
112
 
113
+ # # List the contents of the downloaded directory for debugging
114
+ # logger.info(f"πŸ” Listing contents of {self.model_path}...")
115
+ # run_setup_command(['ls', '-R'], cwd=self.model_path)
116
 
117
  # --- Installation and Compilation ---
118
  logger.info("πŸ”§ Running Hunyuan3D setup scripts with detailed logging...")
 
121
  requirements_path = os.path.join(self.model_path, 'requirements_hunyuan3d.txt')
122
  if os.path.exists(requirements_path):
123
  pip_command = [
124
+ sys.executable, '-m', 'pip', 'install', '--no-build-isolation', '-r', requirements_path,
125
  '--extra-index-url', 'https://mirrors.cloud.tencent.com/pypi/simple/',
126
  '--extra-index-url', 'https://mirrors.aliyun.com/pypi/simple'
127
  ]
128
  run_setup_command(pip_command, cwd=self.model_path)
129
 
130
  # 2. Install custom rasterizer dependencies (torch)
131
+ # logger.info("Installing torch, torchvision, torchaudio...")
132
+ # pip_command_torch = [sys.executable, '-m', 'pip', 'install', 'torch==2.5.1', 'torchvision==0.20.1', 'torchaudio==2.5.1', '--index-url', 'https://download.pytorch.org/whl/cu124']
133
+ # run_setup_command(pip_command_torch, cwd=self.model_path)
134
 
135
  # 3. Install custom rasterizer
136
  rasterizer_path = os.path.join(self.model_path, 'hy3dpaint', 'packages', 'custom_rasterizer')
137
  if os.path.exists(rasterizer_path):
138
+ pip_command_rasterizer = [sys.executable, '-m', 'pip', 'install', '--no-build-isolation', '-e', '.']
139
  run_setup_command(pip_command_rasterizer, cwd=rasterizer_path)
140
 
141
+ # 4. Compile mesh painter
142
  renderer_path = os.path.join(self.model_path, 'hy3dpaint', 'DifferentiableRenderer')
143
  compile_script_path = os.path.join(renderer_path, 'compile_mesh_painter.sh')
144
  if os.path.exists(compile_script_path):
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
  # Core dependencies
2
- gradio>=4.16.0
3
  spaces>=0.19.0
4
 
5
  # AI/ML frameworks
 
1
  # Core dependencies
2
+ gradio>=5.34.2
3
  spaces>=0.19.0
4
 
5
  # AI/ML frameworks