Gpt example

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(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 used to create a template for GPT-3 to follow.
+
'''$create template''' is a function that creates a template for GPT-3 to follow.
  
This function allows the creation of a format with specified prompt and completion that GPT-3 will use to generate its responses.
+
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 lead-in text for the GPT-3 model.
+
'''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 text that completes the prompt.
+
'''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.
  
== Returns ==
+
== Return Value ==
  
A string, formatted as a template using the given prompt and completion.
+
This function returns a formatted string, which is the completed template for use in a GPT-3 training session.
  
 
== Example ==
 
== Example ==
 +
 
<pre>
 
<pre>
$template = $create template("Translate the following English text to French: ", "The cat sat on the mat.")
+
set(#training example, $create template("Translate the following English text to French: 'Hello, world'", "Bonjour, monde"), "Global")
 
</pre>
 
</pre>
In this example, the function creates a new template for GPT-3 to translate a given sentence from English to French. The created template is stored in the variable '$template'.
+
 
 +
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.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox