futurespyhi commited on
Commit
0198d75
·
1 Parent(s): a4c1ace

Add simple debug check for raw_output variable

Browse files

- Add debug information when raw_output is not defined
- Print generation loop parameters for troubleshooting
- Provide clearer error message for generation failures

Files changed (1) hide show
  1. YuEGP/inference/infer.py +8 -0
YuEGP/inference/infer.py CHANGED
@@ -316,6 +316,14 @@ for i, p in enumerate(tqdm(prompt_texts[:run_n_segments])):
316
  raise RuntimeError(f"Generation failed at segment {i}: {e}")
317
 
318
  # save raw output and check sanity
 
 
 
 
 
 
 
 
319
  ids = raw_output[0].cpu().numpy()
320
  soa_idx = np.where(ids == mmtokenizer.soa)[0].tolist()
321
  eoa_idx = np.where(ids == mmtokenizer.eoa)[0].tolist()
 
316
  raise RuntimeError(f"Generation failed at segment {i}: {e}")
317
 
318
  # save raw output and check sanity
319
+ # Check if raw_output was defined (debug for generation issues)
320
+ if 'raw_output' not in locals():
321
+ print("❌ ERROR: raw_output was not defined. This indicates the generation loop failed or didn't execute properly.")
322
+ print(f"run_n_segments: {run_n_segments}")
323
+ print(f"len(lyrics): {len(lyrics)}")
324
+ print(f"prompt_texts length: {len(prompt_texts)}")
325
+ raise RuntimeError("Generation failed - raw_output not defined")
326
+
327
  ids = raw_output[0].cpu().numpy()
328
  soa_idx = np.where(ids == mmtokenizer.soa)[0].tolist()
329
  eoa_idx = np.where(ids == mmtokenizer.eoa)[0].tolist()