Skip to content

Commit

Permalink
Merge pull request #17 from RedHatQuickCourses/grammer_spelling_checks
Browse files Browse the repository at this point in the history
spelling and grammar updates
  • Loading branch information
kknoxrht authored Jun 28, 2024
2 parents 110c0ee + 68aee3f commit dafd9ff
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 37 deletions.
4 changes: 2 additions & 2 deletions modules/chapter1/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ This unit of the journey provides context around the technologies we encounter &

== Why this technical course?

A Formula One Driver doesn't need to know the how to build an engine to be an F1 champion. However, she/he needs to have a *mechanical sympathy*, which is understanding of the car's mechanics to drive it effectively and get the best out it.
A Formula One Driver doesn't need to know how to build an engine to be an F1 champion. However, she/he needs to have a *mechanical sympathy*, which is understanding of the car's mechanics to drive it effectively and get the best out of it.

The same applies to AI. We don't need to be AI experts to harness the power of large language models, but we do need to develop a certain level of *"technological awareness"* about how LLM Models are trained, selected, operationalized, delivered, infered from, fined-Tuned, augmented and kept up-to-date. Not just as users, but as aficionados who understand the underlying components to effectively communicate with clients, partners, and co-workers.
The same applies to AI. We don't need to be AI experts to harness the power of large language models, but we do need to develop a certain level of *"technological awareness"* about how LLM Models are trained, selected, operationalized, delivered, inferred from, fined-tuned, augmented and kept up-to-date. Not just as users, but as aficionados who understand the underlying components to effectively communicate with clients, partners, and co-workers.

The true power lies in the platform that enables us to harness a diverse range of AI models, tools, infrastructure and operationalize our ML projects.

Expand Down
6 changes: 3 additions & 3 deletions modules/chapter1/pages/section2.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ As you probably already know, training large language models is expensive, time

The common outcome from this training is a Foundation model: an LLM designed to generate and understand natural language text across a wide range of use cases.

The key to this powerful language processing architecture, *is the Transformer!* A helpful definition of a *Transformer* is a set of neural networks that consist of an encoder and a decoder with self-attention capabilities. The Transformer was created by Google and started as a language translation algorithm. It analyzes relationships between words in text, which crucial for LLMs to understand and generate language.
The key to this powerful language processing architecture *is the Transformer!* A helpful definition of a *Transformer* is a set of neural networks that consist of an encoder and a decoder with self-attention capabilities. The Transformer was created by Google and started as a language translation algorithm. It analyzes relationships between words in text, which is crucial for LLMs to understand and generate language.

This is how LLMs are able to predict the next words, by using the transformer neural network & attention mechanism to focus in on keywords to determine context. Then use that context and _knowledge_ from all the data ingested to predict the next word after a sequence of words.

Expand All @@ -22,7 +22,7 @@ However, there are techniques for compressing large LLM models, making them sma

* Reducing the precision of LLM parameters to save computational resources without sacrificing performance. Trimming surplus connections or parameters to make LLMs smaller and faster yet performant.

In this course, we will be using a quantized versions of the Mistral and Llama3 Large Language Models. Instead of requiring 24Gb of memory and graphics processing unit to simulate the neural network, we are going to run our model with 4 CPUs and 8GB of ram, burstable to 8 CPU with 10Gb ram max.
In this course, we will be using quantized versions of the Mistral and Llama3 Large Language Models. Instead of requiring 24Gb of memory and graphics processing unit to simulate the neural network, we are going to run our model with 4 CPUs and 8GB of ram, burstable to 8 CPU with 10Gb ram max.


== The Ollama Model Framework
Expand All @@ -38,4 +38,4 @@ At its core, Ollama simplifies the process of downloading, installing, and inter

In this course, we will focus on two LLMs, Mistra and Llama3 run on the Ollama Framework. However, with the understanding of the Ollama Framework, we will be able to work with a variety of large language models utilizing the exact same configuration. https://ollama.com/library[Vist the Ollama library for details on supported Models.]

You will be able to switch models in minutes, all running on the same platform. This will enable you test, compare, and evalute multiple models with the skills gained in the course.
You will be able to switch models in minutes, all running on the same platform. This will enable you to test, compare, and evaluate multiple models with the skills gained in the course.
2 changes: 1 addition & 1 deletion modules/chapter2/pages/section1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ image::openshiftai_operator.png[width=640]
. The operator Installation progress window will pop up. The installation may take a couple of minutes.


WARNING: Do not proceed with the installation past this point. In order to access the LLM remotely; you will need to make some modifcations to the Data Science Cluster YAML file prior to completing the installation of Red Hat OpenShift AI.
WARNING: Do not proceed with the installation past this point. In order to access the LLM remotely; you will need to make some modifications to the Data Science Cluster YAML file prior to completing the installation of Red Hat OpenShift AI.
8 changes: 4 additions & 4 deletions modules/chapter2/pages/section2.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This following procedure explains how to use the same certificate from the OpenS
== Use OpenShift Certificates for Ingress Routes

[NOTE]
Most customers will not use the self-signed certificates, opting instead to use certificates generated by their own authority. Therefore, this step of adding secrets to OpenShift & OpenShift AI is common process during installation.
Most customers will not use the self-signed certificates, opting instead to use certificates generated by their own authority. Therefore, this step of adding secrets to OpenShift & OpenShift AI is a common process during installation.

=== Navigate to the OpenShift Container Cluster Dashboard

Expand All @@ -42,7 +42,7 @@ image::ocp_ingress_cert_yaml.png[width=640]
* Select the *Create* button on the right, then Select the *from YAML* option.
* Delete the text from the Window, and *paste the copied Secret text*

* Cleanup the YAML Text to just keep the relevant content. It should look like the below YAML file (the name of the secret will be different, it's normally tied to the date the RDHP Cluster was deployed).
* Cleanup the YAML Text to just keep the relevant content. It should look like the YAML file below (the name of the secret will be different, it's normally tied to the date the RDHP Cluster was deployed).

```yaml
kind: Secret
Expand All @@ -60,6 +60,6 @@ image::ocp_istio_cert.png[width=640]


* Copy the name of the secret from line 4, just the name (optional, but helpful)
* Click *create* to apply this YAML into the istio-system proejct (namespace).
* Click *create* to apply this YAML into the istio-system project (namespace).

*We have copied the Secret used by OCP & made it available be used by OAI.*
*We have copied the Secret used by OCP & made it available to be used by OAI.*
2 changes: 1 addition & 1 deletion modules/chapter2/pages/section3.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ video::llm_dsc_v3.mp4[width=640]

== Create OpenShift AI Data Science Cluster

With our secrets in place, the next step is to create OpenShift AI *Data Science Cluster*.
With our secrets in place, the next step is to create an OpenShift AI *Data Science Cluster*.

_A DataScienceCluster is the plan in the form of an YAML outline for Data Science Cluster API deployment._

Expand Down
4 changes: 2 additions & 2 deletions modules/chapter3/pages/section2.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
This segment describes a very quick way of deploying the community version of MinIO in order to quickly setup a fully standalone Object Store, in an OpenShift Cluster. This can then be used for various prototyping tasks that require Object Storage.

[WARNING]
This version of MinIO should not be used in production-grade environments. Aditionally, MinIO is not included in RHOAI, and Red Hat does not provide support for MinIO.
This version of MinIO should not be used in production-grade environments. Additionally, MinIO is not included in RHOAI, and Red Hat does not provide support for MinIO.

=== MinIO Deployment
To Deploy MinIO, we will utilize the OpenShift Dashboard.
Expand Down Expand Up @@ -203,7 +203,7 @@ image::minio_routes.png[width=640]

. For the first step, select the UI route and paste it in a browser Window.

. This window opens the MinIO Dashboard. Log in with username/password combination you set, or the default listed in yaml file above.
. This window opens the MinIO Dashboard. Log in with the username/password combination you set, or the defaults listed the in yaml file above.

.. username = minio

Expand Down
2 changes: 1 addition & 1 deletion modules/chapter3/pages/section3.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ image::create_workbench.png[width=640]

.. Notebook Image: `Minimal Python`

.. Leave the remianing options default.
.. Leave the remaining options default.

.. Optionally, scroll to the bottom, check the `Use data connection box`.

Expand Down
14 changes: 7 additions & 7 deletions modules/chapter4/pages/section1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ image::oai_open_jupyter.png[width=640]

. When the new window opens, use the OpenShift admin user & password to login to JupyterLab.

. Click *Allow selected permissions* button to complete login to the notebook.
. Click the *Allow selected permissions* button to complete login to the notebook.


[NOTE]
Expand Down Expand Up @@ -57,7 +57,7 @@ image::add_a_cell.png[width=640]

The Ollama Model Runtime we deployed using the Single Model Serving Platform in OpenShift AI is a Framework that can host various large language models. It is currently running, but is waiting for the command to instruct the framework on which model to download and serve.

. To load the mistral model, we are going use the following python code to instruct the runtime to download and serve a quantized 4 bit version of the mistral large language model.
. To load the mistral model, we are going to use the following python code to instruct the runtime to download and serve a quantized 4 bit version of the mistral large language model.

. Copy the code below and paste this code in the new cell added to the notebook in the previous step.

Expand Down Expand Up @@ -100,7 +100,7 @@ image::replaced_endpoints2.png[width=640]

=== Execute cell code to assemble the langchain components

. We can now start executing the code in the cells, begin with the new cell added to the top. Click on the cell to activate blue indicator to the left of the cell. Next click on the play icon to run the selected cells and advanced to the next. While the cell is executing, an *** (asterisk icon) will appear in the brackets, when complete this will change to a number.
. We can now start executing the code in the cells, beginning with the new cell added to the top. Click on the cell to activate the blue indicator to the left of the cell. Next click on the play icon to run the selected cells and advance to the next. While the cell is executing, an *** (asterisk icon) will appear in the brackets, when complete this will change to a number.

+
image::execute_cell2.png[width=640]
Expand All @@ -115,13 +115,13 @@ image::execute_cell2.png[width=640]

. The next cell imports the *langchain components* that provide the libraries and programming files to interact with our LLM.

. This *"Create the LLM instance"* cell sets the variables that determine how we are going to interact with our model and how it should respond - sets that into an array using *llm* variable.
. This *"Create the LLM instance"* cell sets the variables that determine how we are going to interact with our model and how it should respond - sets that into an array using the *llm* variable.

. Next run the *"Create the prompt"* cell. Here we are setting the *template* variable with the details of how the model operate, including constraints and boundries when generating the response. We often to not experience the system message when interacting with an LLM, but this is a standard field that is included along with the user prompt.
. Next run the *"Create the prompt"* cell. Here we are setting the *template* variable with the details of how the model operates, including constraints and boundaries when generating the response. We often do not experience the system message when interacting with an LLM, but this is a standard field that is included along with the user prompt.

. Continue executing the cells, *"memory for the conversation"* keeps the previous context / conversation history so full history of the chat conversation is sent as part of the prompt.
. Continue executing the cells, *"memory for the conversation"* keeps the previous context / conversation history so the full history of the chat conversation is sent as part of the prompt.

. The *create the chain* cell, combines each of previous variables: llm, prompt, memory, and adds a verbose boolean to create the conversation variable, which will be sent to Models inference endpoint running in OpenShift AI. The verbose option set to true displays the entire conversation sent to the Model in the notebook before the Models (AI's) response.


In the next, section, we'll send our first input to the running Mistral Large Language Model.
In the next section, we'll send our first input to the running Mistral Large Language Model.
22 changes: 11 additions & 11 deletions modules/chapter4/pages/section2.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

== Let's Talk with the LLM

The blue indiacator on the left should now be located at the first input cell. If you have not executed or run all the cells above, please do so now.
The blue indicator on the left should now be located at the first input cell. If you have not executed or run all the cells above, please do so now.

image::first_input.png[width=640]

Expand All @@ -19,7 +19,7 @@ Immediately, green text is shown in the notebook, this is the entire prompt that
. The response from Mistral Model, which is currently processing and will appear in black text


It takes few seconds for the OpenShift AI model to respond with the first words of the reply. The response answered the question in a well-considered informative paragraph that meets the requirement of less than 100 words in length.
It takes a few seconds for the OpenShift AI model to respond with the first words of the reply. The response answered the question in a well-considered informative paragraph that meets the requirement of less than 100 words in length.

image::first_input_response.png[width=800]

Expand All @@ -32,30 +32,30 @@ image::second_input.png[width=800]

== Second Example

Before we continue with London example, we execute a cell to change the conversation mode to non-verbose. This elimiates the context of the prompt displayed in the notebook to instead just show the model's reply.
Before we continue with the London example, we execute a cell to change the conversation mode to non-verbose. This eliminates the context of the prompt displayed in the notebook to instead just show the model's reply.

We also execute a cell to clear memory, or the conversation history reguarding Paris.
We also execute a cell to clear memory, or the conversation history regarding Paris.

We did not disable the memory, or the verbosity of the conversation; we simply hid that section from being visible in the notebook.

Go ahead run the second example cells and evalute the responses from the model.
Go ahead, run the second example cells and evaluate the responses from the model.

image::second_example_response.png[width=800]

== Experiment with Mistral

There are multiple different types of large language models, while we can read about them, using them first hand is best way to experience how they perform.
There are multiple different types of large language models, while we can read about them, using them first hand is the best way to experience how they perform.

So now it's time to experiement on your own, or optionally continue to follow along with this guide.
So now it's time to experiment on your own, or optionally continue to follow along with this guide.


Add a few new cells to the bottom of the Notebook.

image::experiment_setup.png[width=640]


. Experiment by coping the clear conversation cell text, paste the contents into one of the new cells
. Next copy one of the input statements, relace the prompt / question for the model. Then run or execute those cells to learn more about the models capabilities
. Experiment by copying the clear conversation cell text, paste the contents into one of the new cells
. Next copy one of the input statements, replace the prompt / question for the model. Then run or execute those cells to learn more about the models capabilities

I used the following examples:

Expand All @@ -66,10 +66,10 @@ Then I asked one of my standard questions across models to determine it's knowle

*Was George Washington Married?*

Why I ask ths question is several models say GW was married twice. I believed the first one, and this had me thinking several of the next models where wrong. It's critical that we evalute models to determine their viability for business use cases. The Mistral model was wrong in this instance.
Why I ask this question is because several models say GW was married twice. I believed the first one, and this had me thinking several of the next models were wrong. It's critical that we evaluate models to determine their viability for business use cases. The Mistral model was wrong in this instance.

image::experiment1.png[width=800]

Try clearing the memory again and asking more of your own questions to continue to experiment with the Mistral model.

When your ready, move to the next section, where we evaluate a differnet large language model.
When you're ready, move to the next section, where we evaluate a different large language model.
Loading

0 comments on commit dafd9ff

Please sign in to comment.