YaTharThShaRma999 commited on
Commit
7dafa89
1 Parent(s): 5ded0f7

Update modules/audio_ldm.py

Browse files
Files changed (1) hide show
  1. modules/audio_ldm.py +3 -2
modules/audio_ldm.py CHANGED
@@ -11,8 +11,9 @@ class audio_generation:
11
 
12
  def infer(self, prompt, num_length=10, negative="low quality, background sound, average quality, horrible quality"):
13
  prompt = str(prompt)
14
- num_length = num_length.replace('"', '').replace("'", '')
15
- num_length = int(num_length)
 
16
  audio = self.pipe(prompt, num_inference_steps=20, audio_length_in_s=num_length, negative_prompt=negative).audios[0]
17
  num = random.randint(1, 1000)
18
  audio_file = f"audio{num}.wav"
 
11
 
12
  def infer(self, prompt, num_length=10, negative="low quality, background sound, average quality, horrible quality"):
13
  prompt = str(prompt)
14
+ if isinstance(num_length, int):
15
+ num_length = num_length.replace('"', '').replace("'", '')
16
+ num_length = int(num_length)
17
  audio = self.pipe(prompt, num_inference_steps=20, audio_length_in_s=num_length, negative_prompt=negative).audios[0]
18
  num = random.randint(1, 1000)
19
  audio_file = f"audio{num}.wav"