Keep YuE2 jobs live on the bench and wire target length to semantic tokens.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,6 +10,8 @@ test('waiting records never replace the idle GPU status after completion',()=>{
|
||||
assert.deepEqual(gpuStatus([waiting,{...running,state:'complete'}],health),{label:'Ready',tone:'ready',detail:'No job running'});
|
||||
assert.equal(gpuStatus([waiting],health,[{status:'running',name:'Upscale current clip'}]).label,'Upscaling');
|
||||
assert.equal(gpuStatus([waiting],{comfy:{asleep:true}}).label,'Sleeping');
|
||||
assert.equal(gpuStatus([waiting],{comfy:{asleep:true},yue2:{busy:true}}).label,'Generating');
|
||||
assert.equal(gpuStatus([waiting],{comfy:{asleep:true}},[],[{status:'running',name:'song',live:{message:'Planning'}}]).label,'Generating');
|
||||
});
|
||||
test('Unicode video titles produce valid response headers and retain UTF-8 filename',()=>{
|
||||
for(const title of ['A scene… “hello” — 🎥.mp4','日本語.mp4','bad\r\nheader".mp4']){
|
||||
|
||||
@@ -32,6 +32,12 @@ class WorkerTests(unittest.TestCase):
|
||||
self.assertNotEqual(attention, 'flash')
|
||||
self.assertTrue(os.environ.get('PYTORCH_CUDA_ALLOC_CONF', '').startswith('expandable_segments'))
|
||||
|
||||
def test_target_length_maps_to_semantic_max_tokens(self):
|
||||
# 48000 / 1920 = 25 latent frames per second.
|
||||
self.assertEqual(max(200, min(9000, 30 * 25)), 750)
|
||||
self.assertEqual(max(200, min(9000, 15 * 25)), 375)
|
||||
self.assertEqual(max(200, min(9000, 150 * 25)), 3750)
|
||||
|
||||
def test_cuda_oom_detection(self):
|
||||
self.assertTrue(worker.is_cuda_oom(RuntimeError('CUDA out of memory. Tried to allocate 2.49 GiB')))
|
||||
self.assertFalse(worker.is_cuda_oom(RuntimeError('bad lyrics')))
|
||||
|
||||
+2
-1
@@ -18,7 +18,8 @@ test('YuE2 defaults are 60 seconds and allow multiple lyric sections', () => {
|
||||
'[Verse]\nA\n[Chorus]\nB'
|
||||
)
|
||||
assert.throws(() => validateYue2Request({ ...request, lyrics: '' }))
|
||||
assert.throws(() => validateYue2Request({ ...request, duration: 20 }))
|
||||
assert.throws(() => validateYue2Request({ ...request, duration: 10 }))
|
||||
assert.deepEqual(validateYue2Request({ ...request, duration: 15 }).duration, 15)
|
||||
assert.throws(() => validateYue2Request({ ...request, id: '../escape' }))
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user