Text-to-Audio
Transformers
PyTorch
musicgen
dthomas84 commited on
Commit
d44fe94
·
verified ·
1 Parent(s): a9d5db4

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +2 -2
handler.py CHANGED
@@ -46,11 +46,11 @@ class EndpointHandler:
46
 
47
  if audio is not None and is_existing_audio == False:
48
  audio_array = np.array(audio)
49
- audio = audio_array[: len(audio_array) // 2]
50
  # sample["array"] = sample["array"][: len(sample["array"]) // 2]
51
  elif audio is not None and is_existing_audio == True:
52
  audio_array = np.array(audio)
53
- audio = audio_array[len(audio_array) // 2:]
54
 
55
  if duration is not None:
56
  # Calculate max new tokens based on duration, this is a placeholder, replace with actual logic
 
46
 
47
  if audio is not None and is_existing_audio == False:
48
  audio_array = np.array(audio)
49
+ audio = audio_array[: len(audio_array) // 3]
50
  # sample["array"] = sample["array"][: len(sample["array"]) // 2]
51
  elif audio is not None and is_existing_audio == True:
52
  audio_array = np.array(audio)
53
+ audio = audio_array[len(audio_array) // 3:]
54
 
55
  if duration is not None:
56
  # Calculate max new tokens based on duration, this is a placeholder, replace with actual logic