Spaces:
Running on Zero
Running on Zero
Vansh Chugh commited on
Commit ·
c0089ac
1
Parent(s): 828d286
match original pipeline's loop-doubling at max duration
Browse files
app.py
CHANGED
|
@@ -228,6 +228,10 @@ def process_fn(description: str, min_length: float, max_length: float, seed: int
|
|
| 228 |
)
|
| 229 |
result = results[0].to(device="cpu", dtype=torch.float32)
|
| 230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
return _write_temp_wav(result, loopgen.sample_rate)
|
| 232 |
|
| 233 |
|
|
|
|
| 228 |
)
|
| 229 |
result = results[0].to(device="cpu", dtype=torch.float32)
|
| 230 |
|
| 231 |
+
max_duration = int(loopgen.duration * loopgen.frame_rate)
|
| 232 |
+
if valid_tokens[0] == max_duration:
|
| 233 |
+
result = torch.cat([result, result], -1)
|
| 234 |
+
|
| 235 |
return _write_temp_wav(result, loopgen.sample_rate)
|
| 236 |
|
| 237 |
|