Gpt example

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
'''$create gpt template''' is a function that creates a template for GPT-3 to follow. This template allows you to define a proper structure that GPT-3 can understand and respond to accurately.
+
'''$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:''' This is the initial text or prompt for the GPT-3 model.
 
  
'''Completion:''' This is the expected completion of the prompt, demonstrating how GPT-3 should respond.
+
'''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 ==
  
A string containing the template which includes the prompt and completion.  
+
This function returns a formatted string, which is the completed template for use in a GPT-3 training session.
  
== Usage ==
+
== Example ==
  
 
<pre>
 
<pre>
$create gpt template("Translate the following English sentence 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 will format a template for GPT-3. The prompt is "Translate the following English sentence to French:" and the completion is "The cat sat on the mat.". The function then returns this formatted string.
+
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