ZeqiangLai commited on
Commit
4becb3e
·
verified ·
1 Parent(s): d146d20

Update hy3dgen/shapegen/pipelines.py

Browse files
Files changed (1) hide show
  1. hy3dgen/shapegen/pipelines.py +5 -2
hy3dgen/shapegen/pipelines.py CHANGED
@@ -213,10 +213,13 @@ class Hunyuan3DDiTPipeline:
213
  base_dir = os.environ.get('HY3DGEN_MODELS', '~/.cache/hy3dgen')
214
  model_path = os.path.expanduser(os.path.join(base_dir, model_path, 'hunyuan3d-dit-v2-0'))
215
  if not os.path.exists(model_path):
 
216
  try:
217
  import huggingface_hub
218
- # download from huggingface
219
- path = huggingface_hub.snapshot_download(repo_id=original_model_path)
 
 
220
  model_path = os.path.join(path, 'hunyuan3d-dit-v2-0')
221
  except ImportError:
222
  logger.warning(
 
213
  base_dir = os.environ.get('HY3DGEN_MODELS', '~/.cache/hy3dgen')
214
  model_path = os.path.expanduser(os.path.join(base_dir, model_path, 'hunyuan3d-dit-v2-0'))
215
  if not os.path.exists(model_path):
216
+
217
  try:
218
  import huggingface_hub
219
+ path = snapshot_download(
220
+ repo_id=original_model_path,
221
+ allow_patterns=[f"hunyuan3d-dit-v2-0/*"], # 关键修改:模式匹配子文件夹
222
+ )
223
  model_path = os.path.join(path, 'hunyuan3d-dit-v2-0')
224
  except ImportError:
225
  logger.warning(