openai / openai-python

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

client.audio.transcriptions.create receive different results depending on OS #1705

Open Marincor opened 2 months ago

Marincor commented 2 months ago

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

Describe the bug

I'm making a transcription of audio using the transcriptions create method, but even running with the same audio, the same configuration, and the same Python version, I have different results depending on the OS, and to be more precise, when I am running into a windows OS the result is correct, but when running into Linux or Mac, the results is wrong. Some examples of what happened with the transcriptions:

Windows: ok, I will do that, thank you for your support!

Linux and Mac ok, I will do that, do that, do that, do that, do that, do that, do that

Information about the OS that runs the tests: Windows: Windows 11 Home Single Language (version: 23H2) (running inside wsl2 with ubuntu 22.04 distro) (running local) MAC: macOS (version: 14.4.1) (running local) Linux: Amazon Linux 2 - (running inside ECS)

Please, let me know if need more information than that.

To Reproduce

  1. open local audio in format .ogg as binary ("rb"):
    with open('audio.ogg', 'rb') as opened_audio:
  2. file the params with the following params:
    
           transcription_params = {
            'model': 'whisper-1',
            'file': opened_audio,
            'temperature': 0.0,
            'language': 'pt',
            'response_format': 'verbose_json'
        }

3. run as below in different's OS a couple of audios and compare the results:

```python 
  from openai import OpenAI

   with open('audio.ogg', 'rb') as opened_audio:
        transcription_params = {
            'model': 'whisper-1',
            'file': opened_audio,
            'temperature': 0.0,
            'language': 'pt',
            'response_format': 'verbose_json'
        }

        OpenAI().audio.transcriptions.create(**transcription_params)

Code snippets

from openai import OpenAI

   with open('audio.ogg', 'rb') as opened_audio:
        transcription_params = {
            'model': 'whisper-1',
            'file': opened_audio,
            'temperature': 0.0,
            'language': 'pt',
            'response_format': 'verbose_json'
        }

        OpenAI().audio.transcriptions.create(**transcription_params)

OS

MACOS

Python version

3.12.5

Library version

1.42.0

RobertCraigie commented 2 months ago

Thanks for reporting, we'll investigate. I'm curious if you tried making the same request without using the SDK?

Marincor commented 2 months ago

@RobertCraigie

Thanks for reporting, we'll investigate. I'm curious if you tried making the same request without using the SDK?

Hello, Robert, thanks for your return... I tested it now via the endpoint via request instead of the SDK and the behavior is the same (tried both in python and postman).