groq / groq-python

The official Python Library for the Groq API
Apache License 2.0
365 stars 25 forks source link

whisper api fails to use timestamp_granularities #114

Closed asmekal closed 2 weeks ago

asmekal commented 3 weeks ago

The Whisper API does not work with timestamp_granularities, while documentation says it's supposed to

groq.BadRequestError: Error code: 400 - {'error': {'message': '`timestamp_granularities[]` not supported by this model', 'type': 'invalid_request_error'}}

sample code

client = Groq()
with open(audio_filename_in, 'rb') as audio_file:
    chat_completion = client.audio.transcriptions.create(
        file=audio_file,
        model="whisper-large-v3",
        response_format="verbose_json",
        timestamp_granularities=["word"], # with this line commented works
        language="en",
    )

probably related one #107

gradenr commented 2 weeks ago

We only support segment-level timestamps. Word-level timestamps are on the roadmap.

hozen-groq commented 2 weeks ago

@asmekal Please see the above comment and apologies for the confusion. I've taken a note to update the API reference.