ibcplateformes Claude Opus 4.6 commited on
Commit
2af6a2f
·
1 Parent(s): fea49f2

Fix ModuleNotFoundError: clone Seed-VC to app dir instead of /tmp

Browse files

ZeroGPU workers may not share /tmp with the main process. Clone Seed-VC
to the app directory (seed-vc/) which is accessible from both contexts.
Also call setup_seed_vc() inside the GPU function and add detailed error
logging for module import failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (3) hide show
  1. .gitignore +1 -0
  2. pipeline/inference.py +19 -3
  3. pipeline/setup.py +1 -1
.gitignore CHANGED
@@ -12,3 +12,4 @@ build/
12
  logs/
13
  /tmp/
14
  .DS_Store
 
 
12
  logs/
13
  /tmp/
14
  .DS_Store
15
+ seed-vc/
pipeline/inference.py CHANGED
@@ -25,7 +25,7 @@ except ImportError:
25
  return fn
26
  return decorator
27
 
28
- from pipeline.setup import SEED_VC_DIR, ensure_seed_vc_path
29
 
30
  OUTPUT_DIR = "/tmp/rvc_output"
31
 
@@ -38,7 +38,8 @@ def _load_seed_vc_models(device):
38
  if "model" in _model_cache:
39
  return _model_cache
40
 
41
- ensure_seed_vc_path()
 
42
 
43
  # Import Seed-VC's model loading utilities
44
  from modules.commons import recursive_munch, build_model, load_checkpoint
@@ -194,8 +195,23 @@ def convert_voice(
194
  logger.info("Converting voice with Seed-VC on {}".format(device))
195
  logger.info("Source: {}, Reference: {}, Pitch: {}".format(audio_path, reference_path, pitch))
196
 
 
 
 
 
 
 
 
197
  # Load models
198
- cache = _load_seed_vc_models(device)
 
 
 
 
 
 
 
 
199
  model = cache["model"]
200
  semantic_fn = cache["semantic_fn"]
201
  vocoder_fn = cache["vocoder_fn"]
 
25
  return fn
26
  return decorator
27
 
28
+ from pipeline.setup import SEED_VC_DIR, ensure_seed_vc_path, setup_seed_vc
29
 
30
  OUTPUT_DIR = "/tmp/rvc_output"
31
 
 
38
  if "model" in _model_cache:
39
  return _model_cache
40
 
41
+ # Ensure Seed-VC is cloned and on path (critical for ZeroGPU workers)
42
+ setup_seed_vc()
43
 
44
  # Import Seed-VC's model loading utilities
45
  from modules.commons import recursive_munch, build_model, load_checkpoint
 
195
  logger.info("Converting voice with Seed-VC on {}".format(device))
196
  logger.info("Source: {}, Reference: {}, Pitch: {}".format(audio_path, reference_path, pitch))
197
 
198
+ # Ensure Seed-VC is available in this worker process
199
+ try:
200
+ setup_seed_vc()
201
+ except Exception as e:
202
+ logger.error("Seed-VC setup failed in GPU worker: {}".format(e))
203
+ raise RuntimeError("Seed-VC setup failed: {}".format(e))
204
+
205
  # Load models
206
+ try:
207
+ cache = _load_seed_vc_models(device)
208
+ except ModuleNotFoundError as e:
209
+ logger.error("Module not found: {}. sys.path: {}".format(e, sys.path[:5]))
210
+ logger.error("SEED_VC_DIR exists: {}, contents: {}".format(
211
+ os.path.exists(SEED_VC_DIR),
212
+ os.listdir(SEED_VC_DIR) if os.path.exists(SEED_VC_DIR) else "N/A"
213
+ ))
214
+ raise
215
  model = cache["model"]
216
  semantic_fn = cache["semantic_fn"]
217
  vocoder_fn = cache["vocoder_fn"]
pipeline/setup.py CHANGED
@@ -10,7 +10,7 @@ import logging
10
 
11
  logger = logging.getLogger(__name__)
12
 
13
- SEED_VC_DIR = "/tmp/seed-vc"
14
  SEED_VC_REPO = "https://github.com/Plachtaa/seed-vc.git"
15
 
16
 
 
10
 
11
  logger = logging.getLogger(__name__)
12
 
13
+ SEED_VC_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "seed-vc")
14
  SEED_VC_REPO = "https://github.com/Plachtaa/seed-vc.git"
15
 
16