openai-cookbook
openai-cookbook copied to clipboard
Repeating Instruction Examples
Is there a way if I want to query a model for a similar question + set of instruction to avoid passing the instruction every time? eg.
prompt = ['which categories does this <thing> fall in from the list below?\n - fruit \n -vegetable \n etc.']
response = openai.Completion.create(model="text-davinci-003",
prompt=prompt,
temperature=0.0,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
I want to ask this question for a lot of different <things>, and avoid being billed every time for the same words & instructions.
Unfortunately not.
One option is to train a fine-tuned model to do that task, which won't need instructions.
no, unfortunately not, although chatbots dream about this feature

this works so well in the ChatGPT frontend ("do the same"), so: any hints as to how one could "train a fine-tuned model to repeat the task without having to clutter the prompt with its repetition"?
@ted-at-openai on the pricing area it says fine-tuned models are even more expensive for usage ( which would not reduce the cost ).
Once you fine-tune a model, you’ll be billed only for the tokens you use. Requests sent to fine-tuned models are billed at our [usage rates](https://openai.com/api/pricing/#quotas).
@athn-nik, you want to categorize (classify) < things >, and what you are looking for is a way to avoid open.generate each repetitive < thing >, or do I understand it wrong?
Try applying a vector dictionary alongside OpenAI embeddings ( Diversity measurement or classification between < thing > and <already_generated_things> are good examples, in the embeddings link, there is an example of a vectors database using Redis, which might do the trick without any OpenAI resource included )
Disclaimer:
If
Fine-tuned models are more expensive per token. If they allow you to use fewer tokens, they can be less expensive. It depends.
@MuraraAllan I want to do the same "task" for lots of samples, aka ask the same question, give the same instruction and examples and "label" a different text. Eg: Determine if this pose contains the knees. Yoga pose: yes kneel pose: yes Waving pose: [....] Similar to this task for many different [....]