BladeSzaSza commited on
Commit
ba972b4
Β·
1 Parent(s): b82b288

fix(3d-model): Correct UnboundLocalError

Browse files
Files changed (1) hide show
  1. models/model_3d_generator.py +16 -15
models/model_3d_generator.py CHANGED
@@ -76,21 +76,6 @@ class Hunyuan3DGenerator:
76
  logger.info("πŸš€ Starting Hunyuan3D model loading and setup...")
77
 
78
  try:
79
- # Download model repository if not already present
80
- logger.info(f"πŸ“₯ Downloading Hunyuan3D repository from {self.model_id}...")
81
- self.model_path = snapshot_download(
82
- repo_id=self.model_id,
83
- repo_type="space",
84
- cache_dir="./models/hunyuan3d_cache"
85
- )
86
- logger.info(f"βœ… Model repository downloaded to: {self.model_path}")
87
-
88
- # List the contents of the downloaded directory for debugging
89
- logger.info(f"πŸ” Listing contents of {self.model_path}...")
90
- run_setup_command(['ls', '-R'], cwd=self.model_path)
91
-
92
- # --- Installation and Compilation ---
93
- logger.info("πŸ”§ Running Hunyuan3D setup scripts with detailed logging...")
94
  import subprocess
95
  import sys
96
  import os
@@ -116,6 +101,22 @@ class Hunyuan3DGenerator:
116
  logger.error(f"STDERR:\n{e.stderr}")
117
  raise # Re-raise the exception to halt execution and see the error
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  # 1. Install requirements from the model's specific requirements file
120
  requirements_path = os.path.join(self.model_path, 'requirements_hunyuan3d.txt')
121
  if os.path.exists(requirements_path):
 
76
  logger.info("πŸš€ Starting Hunyuan3D model loading and setup...")
77
 
78
  try:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  import subprocess
80
  import sys
81
  import os
 
101
  logger.error(f"STDERR:\n{e.stderr}")
102
  raise # Re-raise the exception to halt execution and see the error
103
 
104
+ # Download model repository if not already present
105
+ logger.info(f"πŸ“₯ Downloading Hunyuan3D repository from {self.model_id}...")
106
+ self.model_path = snapshot_download(
107
+ repo_id=self.model_id,
108
+ repo_type="space",
109
+ cache_dir="./models/hunyuan3d_cache"
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...")
119
+
120
  # 1. Install requirements from the model's specific requirements file
121
  requirements_path = os.path.join(self.model_path, 'requirements_hunyuan3d.txt')
122
  if os.path.exists(requirements_path):