Questions tagged [openai-api]

OpenAI makes several AI products, including ChatGPT, Dall-E, Whisper. Use for questions about the OpenAI API, and not for general support.

Use for questions about using the OpenAI API. All question should be according to the scope of Stack Overflow and following the How to ask a good question and Expected Behavior guidelines.

Before asking a question, read the documentation.

If you will include non-original code, be sure to provide proper attribution.

Don't use for questions about using ChatGPT as an end-user. Don't use for questions about responses given by ChatGPT that aren't directly related to a programming issue using the OpenAI API.

Related tags:


OpenAI Community

https://community.openai.com/

1620 questions
13
votes
5 answers

OpenAI ChatGPT (GPT-3.5) API error: "This is a chat model and not supported in the v1/completions endpoint"

import discord import openai import os openai.api_key = os.environ.get("OPENAI_API_KEY") #Specify the intent intents = discord.Intents.default() intents.members = True #Create Client client = discord.Client(intents=intents) async def…
RAFA 04128
  • 139
  • 1
  • 1
  • 3
13
votes
2 answers

ImportError: Can't find framework /System/Library/Frameworks/OpenGL.framework

I am trying to run this simple gym example on the new macOs Big Sur. import gym env = gym.make('CartPole-v0') env.reset() for _ in range(1000): env.render() env.step(env.action_space.sample()) # take a random action env.close() However, I…
PeeteKeesel
  • 634
  • 1
  • 7
  • 18
12
votes
3 answers

How can I get word-level timestamps in OpenAI's Whisper ASR?

I use OpenAI's Whisper python lib for speech recognition. How can I get word-level timestamps? To transcribe with OpenAI's Whisper (tested on Ubuntu 20.04 x64 LTS with an Nvidia GeForce RTX 3090): conda create -y --name whisperpy39…
11
votes
5 answers

OpenAI: Stream interrupted (client disconnected)

I'm trying OpenAI. I have prepared the training data, and used fine_tunes.create. Several minutes later, it showed Stream interrupted (client disconnected). $ openai api fine_tunes.create -t data_prepared.jsonl Upload progress:…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
11
votes
7 answers

How do I Stream OpenAI's completion API?

I want to stream the results of a completion via OpenAI's API. The doc's mention using server-sent events - it seems like this isn't handled out of the box for flask so I was trying to do it client side (I know this exposes API keys). However,…
Gabriel Pereyra
  • 139
  • 1
  • 1
  • 4
10
votes
2 answers

How to continue incomplete response of openai API

In OpenAI API, how to programmatically check if the response is incomplete? If so, you can add another command like "continue" or "expand" or programmatically continue it perfectly. In my experience, I know that if the response is incomplete, the…
10
votes
5 answers

OpenAI API Refused to set unsafe header "User-Agent"

I don't understand why I am receiving this error. Refused to set unsafe header "User-Agent" I am trying to use OpenAI's API for a personal project. I don't understand why it's refusing to set this "unsafe header" and how, or if, I can make it…
SlickRick
  • 107
  • 1
  • 4
9
votes
1 answer

Streaming ChatGPT's results with Flask and LangChain

Basically I want to achieve this with Flask and LangChain: https://www.youtube.com/watch?v=x8uwwLNxqis. I'm building a Q&A Flask app that uses LangChain in the backend, but I'm having trouble to stream the response from ChatGPT. My chain looks like…
Dante Noguez
  • 91
  • 1
  • 3
9
votes
1 answer

OpenAI GPT-3 API: Fine tune a fine tuned model?

The OpenAI documentation for the model attribute in the fine-tune API states a bit confusingly: model The name of the base model to fine-tune. You can select one of "ada", "babbage", "curie", "davinci", or a fine-tuned model created after…
8
votes
4 answers

How do i add memory to RetrievalQA.from_chain_type? or, how do I add a custom prompt to ConversationalRetrievalChain?

How do i add memory to RetrievalQA.from_chain_type? or, how do I add a custom prompt to ConversationalRetrievalChain? For the past 2 weeks ive been trying to make a chatbot that can chat over documents (so not in just a semantic search/qa so with…
8
votes
2 answers

Llama_index unexpected keyword argument error on ChatGPT Model Python

I'm testing a couple of the widely published GPT models just trying to get my feet wet and I am running into an error that I cannot solve. I am running this code: from llama_index import SimpleDirectoryReader, GPTListIndex, GPTSimpleVectorIndex,…
t25
  • 167
  • 3
  • 14
8
votes
1 answer

OpenAI GPT-4 API: What is the difference between gpt-4 and gpt-4-0314 or gpt-4-0613?

Note: The question was originally asking about the difference between the gpt-4 and gpt-4-0314. As of June 15, 2023, there are new snapshot models available (e.g., gpt-4-0613) so the question and its answer are also relevant for any future snapshot…
Christopher
  • 427
  • 1
  • 8
  • 18
8
votes
2 answers

Fine Tuning an OpenAI GPT-3 model on a collection of documents

According to the documentation https://beta.openai.com/docs/guides/fine-tuning the training data to fine tune an OpenAI GPT3 model should be structured as follows: {"prompt": "", "completion": ""} {"prompt":…
David
  • 7,652
  • 21
  • 60
  • 98
8
votes
1 answer

How do I make sure answers are from a customized (fine-tuning) dataset?

I'm using customized text with 'Prompt' and 'Completion' to train new model. Here's the tutorial I used to create customized model from my data: beta.openai.com/docs/guides/fine-tuning/advanced-usage However even after training the model and sending…
Moshe
  • 208
  • 4
  • 13
8
votes
6 answers

Could not find module \atari_py\ale_interface\ale_c.dll (or one of its dependencies)

I'm trying to work with the openai gym module but I get this error: >>> import atari_py Traceback (most recent call last): File "", line 1, in File…
ssit
  • 128
  • 1
  • 2
  • 6