openai / openai-python

The official Python library for the OpenAI API
https://pypi.org/project/openai/
Apache License 2.0
22.08k stars 3.05k forks source link

1.46.1 audio transcription's temperature param default is not the API's default #1732

Closed saucoide closed 5 hours ago

saucoide commented 5 hours ago

Confirm this is an issue with the Python library and not an underlying OpenAI API

Describe the bug

The API documentation for audio transcriptions says:

temperature number Optional Defaults to 0

The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.

But the behavior between explicitly setting temperature=0 and not passing the param is different, and produces different outputs

To Reproduce

client.audio.transcriptions.create(
        model="whisper-1",
        file=track,
        response_format="verbose_json",
    )

vs

client.audio.transcriptions.create(
        model="whisper-1",
        file=track,
        response_format="verbose_json",
        temperature=0,
    )

Code snippets

No response

OS

linux

Python version

3.12

Library version

1.46.1

RobertCraigie commented 5 hours ago

Thanks for reporting!

This sounds like an issue with the underlying OpenAI API and not the SDK, so I'm going to go ahead and close this issue.

Would you mind reposting at community.openai.com?