Difference between revisions of "Tutorial on using pre-trained OpenAI language models"

(Created page with "'''Under construction -- no ready to be used yet''' In this tutorial you will learn how to use language models (via the OpenAI API) from your Analytica model, and also learn...")
 
Line 1: Line 1:
'''Under construction -- no ready to be used yet'''
+
'''Under construction -- no ready to be used yet'''
  
 
In this tutorial you will learn how to use language models (via the OpenAI API) from your Analytica model, and also learn about language models and how they work.
 
In this tutorial you will learn how to use language models (via the OpenAI API) from your Analytica model, and also learn about language models and how they work.
Line 7: Line 7:
 
( Create new model. Add library to model )
 
( Create new model. Add library to model )
 
( Getting and entering the OpenAI API key )
 
( Getting and entering the OpenAI API key )
 +
 +
The OpenAI API Library needs to be integrated into your model for you to access its functionality. Here's a step-by-step guide on how to do it:
 +
 +
# '''Download the OpenAI API Library:''' The first step is to download the OpenAI library. Make sure to save it in a location you can easily access.
 +
# '''Create a New Model:''' After the download is complete, open Analytica and create a new model. This will serve as your workspace.
 +
# '''Add the Library to the Model:''' Locate the "File" button on the top-left corner of the Analytica interface, click on it, and select the option "Add Module".
 +
# '''Select the Library File:''' In the file selection dialog that appears, navigate to where you saved the OpenAI library file and select it.
 +
# '''Embed the Library:''' Once you've selected the library file, a new dialog will open up. Choose the "Embed a copy" option. This action embeds a copy of the library directly into your model.
 +
# '''Save Your API Key:''' Lastly, open the embedded OpenAI API library module. Locate the section where you can save your API key. Input your OpenAI API key into the designated environment variable to finalize the setup.
  
 
== What OpenAI models are available to use? ==
 
== What OpenAI models are available to use? ==

Revision as of 16:08, 26 July 2023

Under construction -- no ready to be used yet

In this tutorial you will learn how to use language models (via the OpenAI API) from your Analytica model, and also learn about language models and how they work.

Adding the OpenAI API library to your model

( Downloading the library) ( Create new model. Add library to model ) ( Getting and entering the OpenAI API key )

The OpenAI API Library needs to be integrated into your model for you to access its functionality. Here's a step-by-step guide on how to do it:

  1. Download the OpenAI API Library: The first step is to download the OpenAI library. Make sure to save it in a location you can easily access.
  2. Create a New Model: After the download is complete, open Analytica and create a new model. This will serve as your workspace.
  3. Add the Library to the Model: Locate the "File" button on the top-left corner of the Analytica interface, click on it, and select the option "Add Module".
  4. Select the Library File: In the file selection dialog that appears, navigate to where you saved the OpenAI library file and select it.
  5. Embed the Library: Once you've selected the library file, a new dialog will open up. Choose the "Embed a copy" option. This action embeds a copy of the library directly into your model.
  6. Save Your API Key: Lastly, open the embedded OpenAI API library module. Locate the section where you can save your API key. Input your OpenAI API key into the designated environment variable to finalize the setup.

What OpenAI models are available to use?

Generating text completions

Word likelihoods

(tutorial about next token probabilities. logits and perplexity, etc.)

Controlling completion randomness

In-context learning

(What is in-context learning?) (Some examples: Translation, ....)

Creating classifiers using in-context learning

What is a classifer?

(Classifier Task 1)

(Download the training / test set) (Write the n-shot prompt) (Evaluate performance on several test cases)

(Classifier Task 2)

Managing a conversation

Comparing different models

Similarity embeddings

(Uses) (Computing similarities) (Indexing a collection of docs) (Adding similar snippet to LLM prompts)

Comments


You are not allowed to post comments.