ACloudCenter commited on
Commit
ba3193a
·
verified ·
1 Parent(s): 8bf7282

Fix: import sys as _sys2 in inserted block (sys unbound in finetune main)

Browse files
Files changed (1) hide show
  1. emo_train_wrapper.sh +4 -3
emo_train_wrapper.sh CHANGED
@@ -57,10 +57,11 @@ assert a1 in s, "lm anchor missing"
57
  s = s.replace(a1, a1 + """
58
  if os.path.isfile("/fullv3/adapter_config.json"):
59
  import importlib.util as _ilu2
 
60
  from pathlib import Path as _P
61
  _spec2 = _ilu2.spec_from_file_location("lora_loading_ws", "/vv-main/vibevoice/modular/lora_loading.py")
62
  _mod2 = _ilu2.module_from_spec(_spec2)
63
- sys.modules[_spec2.name] = _mod2
64
  _spec2.loader.exec_module(_mod2)
65
  _rep = _mod2._LoadReport()
66
  _dev = next(model.parameters()).device
@@ -81,7 +82,7 @@ s = s.replace(a2, a2 + """
81
  getattr(model.model, _cname).load_state_dict(torch.load(_cp, map_location="cpu"), strict=False)
82
  print(f"WARMSTART {_cname} OK", flush=True)""")
83
  open(p, "w").write(s)
84
- print("WARMSTART PATCH OK (peft-loader LM init)", flush=True)
85
  WS
86
  echo '== TRAIN (emotion-LoRA warm-start, 800 steps) =='
87
  python -m src.finetune_vibevoice_lora \
@@ -115,7 +116,7 @@ PUSH
115
  python - <<'LOG'
116
  from huggingface_hub import HfApi
117
  try:
118
- HfApi().upload_file(path_or_fileobj="/tmp/joblog.txt", path_in_repo="emo-train-log-v3.txt", repo_id="ACloudCenter/fast-vibevoice-notes", repo_type="dataset")
119
  print("LOG OK", flush=True)
120
  except Exception as e:
121
  print("LOG FAIL", e, flush=True)
 
57
  s = s.replace(a1, a1 + """
58
  if os.path.isfile("/fullv3/adapter_config.json"):
59
  import importlib.util as _ilu2
60
+ import sys as _sys2
61
  from pathlib import Path as _P
62
  _spec2 = _ilu2.spec_from_file_location("lora_loading_ws", "/vv-main/vibevoice/modular/lora_loading.py")
63
  _mod2 = _ilu2.module_from_spec(_spec2)
64
+ _sys2.modules[_spec2.name] = _mod2
65
  _spec2.loader.exec_module(_mod2)
66
  _rep = _mod2._LoadReport()
67
  _dev = next(model.parameters()).device
 
82
  getattr(model.model, _cname).load_state_dict(torch.load(_cp, map_location="cpu"), strict=False)
83
  print(f"WARMSTART {_cname} OK", flush=True)""")
84
  open(p, "w").write(s)
85
+ print("WARMSTART PATCH OK (peft-loader LM init, sys bound)", flush=True)
86
  WS
87
  echo '== TRAIN (emotion-LoRA warm-start, 800 steps) =='
88
  python -m src.finetune_vibevoice_lora \
 
116
  python - <<'LOG'
117
  from huggingface_hub import HfApi
118
  try:
119
+ HfApi().upload_file(path_or_fileobj="/tmp/joblog.txt", path_in_repo="emo-train-log-v4.txt", repo_id="ACloudCenter/fast-vibevoice-notes", repo_type="dataset")
120
  print("LOG OK", flush=True)
121
  except Exception as e:
122
  print("LOG FAIL", e, flush=True)