You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Transcribe Group will yield results in a different order that inputs #79
Calling transcriptions = transcriber.transcribe_group([str(c.audio_file) for c in audio_chunks])
may yield the results out-of-order, i.e., transcriptions[i] does not correspond to audio_chunks[i]. Is this intended? If yes, how are we supposed to know what corresponds to what?
Hi, thanks for flagging! Yes, it's using concurrent.futures.wait() under the hood so it does not preserve the order. It will return results in the order they become available.
Unfortunately, I don't see a way to connect inputs with outputs the way it is implemented right now, so you'd have to write your own logic to submit multiple files concurrently and preserve the order.
We can try to work on an enhancement that makes sure the order is preserved. If not, at the very least this should be mentioned in the function docstring.
Activity
ploeber commentedon Jul 23, 2024
Hi, thanks for flagging! Yes, it's using
concurrent.futures.wait()under the hood so it does not preserve the order. It will return results in the order they become available.Unfortunately, I don't see a way to connect inputs with outputs the way it is implemented right now, so you'd have to write your own logic to submit multiple files concurrently and preserve the order.
We can try to work on an enhancement that makes sure the order is preserved. If not, at the very least this should be mentioned in the function docstring.
serozhenka commentedon Aug 2, 2024
@Ruben-Kruepper
As a temporary workaround, I have used the following code:
Agree that it's not as clear as wanted, but it is what it its :)
Ruben-Kruepper commentedon Aug 2, 2024
@serozhenka
Good one, very compact! We're using this, which maps quite closely onto what the SDK is doing under the hood right now.
Which is also very useful for general parallel API calls 😁