Gpt example
(Created page with "'''$create template''' is a function used to create a template for GPT-3 to follow. This function allows the creation of a format with specified prompt and completion that GP...") |
|||
(2 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | '''$create template''' is a function | + | '''$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:''' 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:''' 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 == |
− | + | This function returns a formatted string, which is the completed template for use in a GPT-3 training session. | |
== Example == | == Example == | ||
+ | |||
<pre> | <pre> | ||
− | + | 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.