openai-java icon indicating copy to clipboard operation
openai-java copied to clipboard

whisper

Open ahmedaa6122 opened this issue 2 years ago • 6 comments
trafficstars

Can use whisper-1 using this library if yes how .

ahmedaa6122 avatar Mar 17 '23 14:03 ahmedaa6122

You might be able to try the new Stream feature w/ the whisper model. I think it might have to be split out into a new completion though given the media types--though the image return is just bytes typed to a class.

Oh, I just checked, it's a different endpoint, so it'll have to be supported in the code.

curl https://api.openai.com/v1/audio/transcriptions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -F model="whisper-1" \
  -F file="@/path/to/file/openai.mp3"

cryptoapebot avatar Mar 17 '23 15:03 cryptoapebot

@cryptoapebot can send me example

ahmedaa6122 avatar Mar 17 '23 15:03 ahmedaa6122

So it looks like the endpoint takes an audio, multipart file and then returns the text. That should be easy to handle by just calling the right endpoint which isn't supported in this API just yet.

cryptoapebot avatar Mar 17 '23 15:03 cryptoapebot

@cryptoapebot thanks, and are you know about gpt 4 ?

ahmedaa6122 avatar Mar 17 '23 15:03 ahmedaa6122

Yes, if you have access to it, which I think they provide now, you can just use one of these in the models field w/ the existing OpenAIService.

gpt-4, gpt-4-0314, gpt-4-32k, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-0301

If you are signed in or have your key through Postman, you can find their model cards here: https://api.openai.com/v1/models

cryptoapebot avatar Mar 17 '23 15:03 cryptoapebot

@cryptoapebot its use same api thats use in gpt 3.5 but different in model ?

ahmedaa6122 avatar Mar 17 '23 15:03 ahmedaa6122

I know this is listed as completed, but documenting it here for future reference. You have to use the /v1/chat/completions, not the /v1/completions. Which means completion of type: ChatCompletionRequest

cryptoapebot avatar Mar 28 '23 18:03 cryptoapebot