Spaces:
Running
Running
Fixes, working version
Browse files- app.py +2 -2
- audiocraft/utils/extend.py +1 -1
app.py
CHANGED
@@ -67,9 +67,9 @@ def predict(model, text, melody, duration, topk, topp, temperature, cfg_coef):
|
|
67 |
try:
|
68 |
# Combine the output segments into one long audio file
|
69 |
output_segments = [segment.detach().cpu().float()[0] for segment in output_segments]
|
70 |
-
output = torch.cat(output_segments, dim=
|
71 |
except Exception as e:
|
72 |
-
print(f"
|
73 |
output = output_segments[0].detach().cpu().float()[0]
|
74 |
else:
|
75 |
output = output.detach().cpu().float()[0]
|
|
|
67 |
try:
|
68 |
# Combine the output segments into one long audio file
|
69 |
output_segments = [segment.detach().cpu().float()[0] for segment in output_segments]
|
70 |
+
output = torch.cat(output_segments, dim=1)
|
71 |
except Exception as e:
|
72 |
+
print(f"Error combining segments: {e}. Using the first segment only.")
|
73 |
output = output_segments[0].detach().cpu().float()[0]
|
74 |
else:
|
75 |
output = output.detach().cpu().float()[0]
|
audiocraft/utils/extend.py
CHANGED
@@ -67,7 +67,7 @@ def generate_music_segments(text, melody, MODEL, duration:int=10, segment_durati
|
|
67 |
# Append the generated output to the list of segments
|
68 |
#output_segments.append(output[:, :segment_duration])
|
69 |
output_segments.append(output)
|
70 |
-
print(f"output_segments: {len(output_segments)}: shape
|
71 |
return output_segments
|
72 |
|
73 |
#def generate_music_segments(text, melody, duration, MODEL, segment_duration=30):
|
|
|
67 |
# Append the generated output to the list of segments
|
68 |
#output_segments.append(output[:, :segment_duration])
|
69 |
output_segments.append(output)
|
70 |
+
print(f"output_segments: {len(output_segments)}: shape: {output.shape} dim {output.dim()}")
|
71 |
return output_segments
|
72 |
|
73 |
#def generate_music_segments(text, melody, duration, MODEL, segment_duration=30):
|