Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excessive Time Required for Music Generation #18

Open
HuangMason320 opened this issue Oct 22, 2024 · 0 comments
Open

Excessive Time Required for Music Generation #18

HuangMason320 opened this issue Oct 22, 2024 · 0 comments

Comments

@HuangMason320
Copy link

HuangMason320 commented Oct 22, 2024

I am experiencing unusually long processing times when generating music using my local setup. Specifically, generating a 10-second music segment takes over 1 hour to complete on my machine.

Environment
• GPU: NVIDIA GeForce RTX 2070
• CPU: INTEL i7-7700
• Operating System: Windows 11

Below is the code I run:

import soundfile as sf
from mustango import Mustango
import time

start = time.time()

model = Mustango("declare-lab/mustango")

prompt = "Compose an instrumental piece that captures the lively yet elegant atmosphere of Leipzig city square in the 19th century. Picture a bustling, vibrant scene filled with people in traditional 19th-century attire going about their day in a German city square. The music should evoke a sense of history, community, and culture. Start with a light orchestral arrangement, using strings, woodwinds, and brass to reflect the classical and romantic musical traditions of the 1800s. Include a lively waltz-like rhythm to convey the activity of the bustling marketplace, where vendors, townsfolk, and carriages all create a sense of movement and energy. Introduce a solo violin or clarinet melody to give a sense of personal storytelling, like a street musician entertaining passersby. Blend in soft brass sections to convey grandeur, reminiscent of Leipzig’s cultural prominence as a city of music and trade fairs. To evoke a historical setting, include elements typical of 19th-century German folk music, such as brief interludes with accordion-like harmonies or plucked string instruments like the lute. Make sure the piece progresses dynamically to reflect different aspects of the square—starting with a moderate, upbeat tempo representing the morning’s excitement, and slowly transitioning to a more relaxed and reflective section for the afternoon lull, where townsfolk might gather at a café. The music should conclude with a sense of fulfillment, perhaps using a major key to evoke the golden glow of the setting sun over the square. Overall, the composition should feel nostalgic, lively, and classically elegant, allowing the listener to be transported to 19th-century Leipzig with all its cultural richness and charm."

music = model.generate(prompt)
sf.write(f"output.wav", music, samplerate=64000)

end = time.time()
print(f"Execution time: {end - start} seconds") 

Is this processing time normal for the current setup?

I would appreciate any guidance or suggestions to resolve this issue. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant