Gpt example
Line 1: | Line 1: | ||
− | '''$create | + | '''$create template''' is a function that creates a template for GPT-3 to follow. |
+ | |||
+ | When training GPT-3 for specific tasks, it often helps to provide a prompt-completion pair as an example. This function helps in formatting these examples for training the model more effectively. | ||
== Parameters == | == Parameters == | ||
− | |||
− | |||
− | ''' | + | '''Prompt:''' The prompt that you want to send to the GPT-3 model. This should be a clear, guiding string that steers the model to produce the desired output. |
+ | |||
+ | '''Completion:''' The completion for the given prompt. This should be a demonstration of the expected output for the given prompt, essentially the answer or response to your prompt. | ||
== Return Value == | == Return Value == | ||
− | + | This function returns a formatted string, which is the completed template for use in a GPT-3 training session. | |
− | == | + | == Example == |
<pre> | <pre> | ||
− | $create | + | set(#training example, $create template("Translate the following English text to French: 'Hello, world'", "Bonjour, monde"), "Global") |
</pre> | </pre> | ||
− | In this example, the | + | In this example, both the prompt and its related completion are used to create a training example for GPT-3 — the prompt asks GPT-3 to translate the English phrase "Hello, world" into French, and the completion gives the correct translation, "Bonjour, monde". The formatted string is then stored in the #training example variable. The generated template will look like this: |
+ | |||
+ | <blockquote> | ||
+ | "Translate the following English text to French: 'Hello, world'\n\nBonjour, monde" | ||
+ | </blockquote> | ||
+ | |||
+ | This formatted string can then be used to train a GPT-3 model. |
Latest revision as of 19:43, 30 June 2023
$create template is a function that creates a template for GPT-3 to follow.
When training GPT-3 for specific tasks, it often helps to provide a prompt-completion pair as an example. This function helps in formatting these examples for training the model more effectively.
[edit] Parameters
Prompt: The prompt that you want to send to the GPT-3 model. This should be a clear, guiding string that steers the model to produce the desired output.
Completion: The completion for the given prompt. This should be a demonstration of the expected output for the given prompt, essentially the answer or response to your prompt.
[edit] Return Value
This function returns a formatted string, which is the completed template for use in a GPT-3 training session.
[edit] Example
set(#training example, $create template("Translate the following English text to French: 'Hello, world'", "Bonjour, monde"), "Global")
In this example, both the prompt and its related completion are used to create a training example for GPT-3 — the prompt asks GPT-3 to translate the English phrase "Hello, world" into French, and the completion gives the correct translation, "Bonjour, monde". The formatted string is then stored in the #training example variable. The generated template will look like this:
"Translate the following English text to French: 'Hello, world'\n\nBonjour, monde"
This formatted string can then be used to train a GPT-3 model.