happylittlecat2333 / Auffusion

Official codes and models of the paper "Auffusion: Leveraging the Power of Diffusion and Large Language Models for Text-to-Audio Generation"
https://auffusion.github.io/
Other
160 stars 13 forks source link

pt_to_numpy in auffusion_pipeline.py has 'staticmethod' object is not callable error #4

Closed Harushii18 closed 10 months ago

Harushii18 commented 10 months ago

I have followed the installation steps given and have run the code in a jupyter notebook. Upon running the lines below, I get the ffg error

TypeError                                 Traceback (most recent call last)
Cell In[6], line 2
      1 prompt = "Birds singing sweetly in a blooming garden"
----> 2 output = pipeline(prompt=prompt)
      3 audio = output.audios[0]
      4 sf.write(f"{prompt}.wav", audio, samplerate=16000)

File /opt/conda/envs/auffusion/lib/python3.9/site-packages/torch/utils/_contextlib.py:115, in context_decorator.<locals>.decorate_context(*args, **kwargs)
    112 @functools.wraps(func)
    113 def decorate_context(*args, **kwargs):
    114     with ctx_factory():
--> 115         return func(*args, **kwargs)

File ~/work/Auffusion/auffusion_pipeline.py:1026, in AuffusionPipeline.__call__(self, prompt, height, width, num_inference_steps, guidance_scale, negative_prompt, num_images_per_prompt, eta, generator, latents, prompt_embeds, negative_prompt_embeds, output_type, return_dict, callback, callback_steps, cross_attention_kwargs, guidance_rescale, duration)
   1023     spectrograms.append(spectrogram)
   1025 # Convert to PIL
-> 1026 images = pt_to_numpy(image)    
   1027 images = numpy_to_pil(images)
   1028 images = [image_add_color(image) for image in images]

TypeError: 'staticmethod' object is not callable
happylittlecat2333 commented 10 months ago

Please just try to remove the line including @staticmethod in line 372 and line 380 from auffusion_pipeline.py. Or try to use text-to-audio colab notebook and other manipulation colab for more convenient try.

Harushii18 commented 10 months ago

Thank you, will let you know if it works!

Harushii18 commented 10 months ago

Just an update, I ran it locally and it generates, thank you