gpt-3

OpenAI fine-tune with python return null model

OpenAI fine-tune with python return null model Question: I am trying to get fine-tune model from OpenAI GPT-3 using python with following code #upload training data upload_response = openai.File.create( file=open(file_name, "rb"), purpose=’fine-tune’ ) file_id = upload_response.id print(f’nupload training data respond:nn {upload_response}’) OpenAI respond with data { "bytes": 380, "created_at": 1675789714, "filename": "file", "id": "file-lKSQushd8eABcfiBVwhxBMOJ", "object": …

Total answers: 2

No module named 'openai_secret_manager'

No module named 'openai_secret_manager' Question: I asked ChatGPT about my CSV data, and ChatGPT answered: "Here is an example of how you can read a CSV file using pandas, and then use the data to train or fine-tune GPT-3 using the OpenAI API:" import pandas as pd import openai_secret_manager # Read the CSV file df …

Total answers: 2

OpenAI GPT-3 API error: "InvalidRequestError: Unrecognized request argument supplied"

OpenAI GPT-3 API error: "InvalidRequestError: Unrecognized request argument supplied" Question: import openai # Set the API key openai.api_key = "YOUR API KEY" # Define the conversation memory conversation_memory = { "previous_question": "What is the capital of France?", "previous_answer": "The capital of France is Paris." } # Make the API request response = openai.Completion.create( model="text-davinci-003", prompt="Where …

Total answers: 1

How to get the items inside of an OpenAIobject in python?

How to get the items inside of an OpenAIobject in Python? Question: I would like to get the text inside this data structure that is outputted via GPT3 OpenAI. I’m using Python. When I print the object I get: <OpenAIObject text_completion id=cmpl-6F7ScZDu2UKKJGPXTiTPNKgfrikZ at 0x7f7648cacef0> JSON: { "choices": [ { "finish_reason": "stop", "index": 0, "logprobs": null, …

Total answers: 2

How to use GPT-3 for fill-mask tasks?

How to use GPT-3 for fill-mask tasks? Question: I use the following code to get the most likely replacements for a masked word: !pip install git+https://github.com/huggingface/transformers.git import torch import pandas as pd from transformers import AutoModelForMaskedLM, AutoTokenizer, pipeline unmasker = pipeline(‘fill-mask’, model=’bert-base-uncased’, top_k=100) tokenizer = AutoTokenizer.from_pretrained(‘bert-base-uncased’) model = AutoModelForMaskedLM.from_pretrained(‘bert-base-uncased’) results = unmasker(f"The sun is [MASK].") …

Total answers: 1

How to use files in the Answer api of OpenAI

How to use files in the Answer api of OpenAI Question: As finally OpenAI opened the GPT-3 related API publicly, I am playing with it to explore and discover his potential. I am trying the Answer API, the simple example that is in the documentation: https://beta.openai.com/docs/guides/answers I upload the .jsonl file as indicated, and I …

Total answers: 1

How to get th content of a string inside a request response?

How to get th content of a string inside a request response? Question: I was coding a webapp based on GPT-2 but it was not good so I decided to switch to official OpenAI GPT-3. So I make that request: response = openai.Completion.create( engine="davinci", prompt="Hello", temperature=0.7, max_tokens=64, top_p=1, frequency_penalty=0, presence_penalty=0 ) And when I print …

Total answers: 3

How to save pre-trained API on GPT-3?

How to save pre-trained API on GPT-3? Question: I have a question about GPT-3. As we know we can give some examples to the network and "adjust" the model. Show examples to the model. Save these examples. Reuse the APIs. import openai class Example(): """Stores an input, output pair and formats it to prime the …

Total answers: 2