Skip to content

Commit

Permalink
fix: images names and paths
Browse files Browse the repository at this point in the history
  • Loading branch information
john0isaac committed Nov 9, 2023
1 parent 552e479 commit d354f7b
Show file tree
Hide file tree
Showing 43 changed files with 59 additions and 60 deletions.
Binary file not shown.
1 change: 0 additions & 1 deletion 02-exploring-and-comparing-different-llms/images/README.md

This file was deleted.

4 changes: 2 additions & 2 deletions 03-using-generative-ai-responsibly/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Using Generative AI Responsibly

[![Using Generative AI Responsibly](./images/genai_course_3[77].png?WT.mc_id=academic-105485-koreyst)]()
[![Using Generative AI Responsibly](./images/03-lesson-banner.png?WT.mc_id=academic-105485-koreyst)]()

> **Video Coming Soon**
Expand Down Expand Up @@ -44,7 +44,7 @@ Let's take for example we build a feature for our startup that allows students t

The model produces a response like the one below:

![Prompt saying "Who was the sole survivor of the Titanic"](../03-using-generative-ai-responsibly/images/2135-ChatGPT(1)_11zon.webp?WT.mc_id=academic-105485-koreyst)
![Prompt saying "Who was the sole survivor of the Titanic"](../03-using-generative-ai-responsibly/images/ChatGPT-titanic-survivor-prompt.webp?WT.mc_id=academic-105485-koreyst)

> *(Source: [Flying bisons](https://flyingbisons.com?WT.mc_id=academic-105485-koreyst))*
Expand Down
4 changes: 2 additions & 2 deletions 03-using-generative-ai-responsibly/translations/cn/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 第三章 : 负责任地使用生成式人工智能

[![Using Generative AI Responsibly](../../images/genai_course_3[77].png?WT.mc_id=academic-105485-koreyst)]()
[![Using Generative AI Responsibly](../../images/03-lesson-banner.png?WT.mc_id=academic-105485-koreyst)]()

> **导学视频即将上架,敬请期待**
Expand Down Expand Up @@ -44,7 +44,7 @@

该模型产生如下响应:

![提示说“谁是泰坦尼克号的唯一幸存者”](../../../03-using-generative-ai-responsibly/images/2135-ChatGPT(1)_11zon.webp)
![提示说“谁是泰坦尼克号的唯一幸存者”](../../../03-using-generative-ai-responsibly/images/ChatGPT-titanic-survivor-prompt.webp?WT.mc_id=academic-105485-koreyst)

> *(来源:[飞翔的野牛](https://flyingbisons.com?WT.mc_id=academic-105485-koreyst))*
Expand Down
14 changes: 7 additions & 7 deletions 04-prompt-engineering-fundamentals/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prompt Engineering Fundamentals

[![Prompt Engineering Fundamentals](./img/04-lesson-banner.png?WT.mc_id=academic-105485-koreyst)](https://youtu.be/r2ItK3UMVTk?WT.mc_id=academic-105485-koreyst)
[![Prompt Engineering Fundamentals](./images/04-lesson-banner.png?WT.mc_id=academic-105485-koreyst)](https://youtu.be/r2ItK3UMVTk?WT.mc_id=academic-105485-koreyst)


How you write your prompt to the LLM matters, a carefully crafted prompt can achieve achieve a better result than one that isn't. But what even are these concepts, prompt, prompt engineering and how do I improve what I send to the LLM? Questions like these are what this chapter and the upcoming chapter are looking to answer.
Expand Down Expand Up @@ -77,7 +77,7 @@ An LLM sees prompts as a _sequence of tokens_ where different models (or version

To get an intuition for how tokenization works, try tools like the [OpenAI Tokenizer](https://platform.openai.com/tokenizer?WT.mc_id=academic-105485-koreyst) shown below. Copy in your prompt - and see how that gets converted into tokens, paying attention to how whitespace characters and punctuation marks are handled. Note that this example shows an older LLM (GPT-3) - so trying this with a newer model may produce a different result.

![Tokenization](./img/4.0-tokenizer-example.png?WT.mc_id=academic-105485-koreyst)
![Tokenization](./images/04-tokenizer-example.png?WT.mc_id=academic-105485-koreyst)

### Concept: Foundation Models

Expand All @@ -87,7 +87,7 @@ Want to see how prompt-based completion works? Enter the above prompt into the A

But what if the user wanted to see something specific that met some criteria or task objective? This is where _instruction-tuned_ LLMs come into the picture.

![Base LLM Chat Completion](./img/4.0-playground-chat-base.png?WT.mc_id=academic-105485-koreyst)
![Base LLM Chat Completion](./images/04-playground-chat-base.png?WT.mc_id=academic-105485-koreyst)

### Concept: Instruction Tuned LLMs

Expand All @@ -101,7 +101,7 @@ Let's try it out - revisit the prompt above but now change the _system message_
See how the result is now tuned to reflect the desired goal and format? An educator can now directly use this response in their slides for that class.

![Instruction Tuned LLM Chat Completion](./img/4.0-playground-chat-instructions.png?WT.mc_id=academic-105485-koreyst)
![Instruction Tuned LLM Chat Completion](./images/04-playground-chat-instructions.png?WT.mc_id=academic-105485-koreyst)

## Why do we need Prompt Engineering?

Expand Down Expand Up @@ -129,15 +129,15 @@ So what happens when we run this prompt with different LLM providers?

> **Response 1**: OpenAI Playground (GPT-35)
![Response 1](./img/4.0-hallucination-oai.png?WT.mc_id=academic-105485-koreyst)
![Response 1](./images/04-hallucination-oai.png?WT.mc_id=academic-105485-koreyst)

> **Response 2**: Azure OpenAI Playground (GPT-35)
![Response 2](./img/4.0-hallucination-aoai.png?WT.mc_id=academic-105485-koreyst)
![Response 2](./images/04-hallucination-aoai.png?WT.mc_id=academic-105485-koreyst)

> **Response 3**: : Hugging Face Chat Playground (LLama-2)
![Response 3](./img/4.0-hallucination-huggingchat.png?WT.mc_id=academic-105485-koreyst)
![Response 3](./images/04-hallucination-huggingchat.png?WT.mc_id=academic-105485-koreyst)

As expected, each model (or model version) produces slightly different responses thanks to stochastic behavior and model capability variations. For instance, one model targets an 8th grade audience while the other assumes a high-school student. But all three models did generate responses that could convince an uninformed user that the event was real

Expand Down
14 changes: 7 additions & 7 deletions 04-prompt-engineering-fundamentals/translations/cn/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 第四章:提示工程基础

[![Prompt Engineering Fundamentals](../../img/04-lesson-banner.png?WT.mc_id=academic-105485-koreyst)](https://youtu.be/r2ItK3UMVTk?WT.mc_id=academic-105485-koreyst)
[![Prompt Engineering Fundamentals](../../images/04-lesson-banner.png?WT.mc_id=academic-105485-koreyst)](https://youtu.be/r2ItK3UMVTk?WT.mc_id=academic-105485-koreyst)


如何撰写 LLM 的提示很重要,精心设计的提示可以比不精心设计的提示取得更好的结果。 但这些概念到底是什么,提示、提示工程以及我如何改进我发送给 LLMs 的内容? 诸如此类的问题正是本章和下一章想要解答的。
Expand Down Expand Up @@ -79,7 +79,7 @@ LLM 将提示视为标记序列,其中不同的模型(或模型的版本)

要直观地了解标记化的工作原理,请尝试使用如下所示的 [OpenAI Tokenizer](https://platform.openai.com/tokenizer?WT.mc_id=academic-105485-koreyst) 等工具。 复制您的提示 - 并查看如何将其转换为标记,注意空白字符和标点符号的处理方式。 请注意,此例子显示的是较旧的 LLM (GPT-3) - 因此使用较新的模型尝试此操作可能会产生不同的结果。

![Tokenization](../../img/4.0-tokenizer-example.png?WT.mc_id=academic-105485-koreyst)
![Tokenization](../../images/04-tokenizer-example.png?WT.mc_id=academic-105485-koreyst)

### 概念: 基础模型

Expand All @@ -95,7 +95,7 @@ But what if the user wanted to see something specific that met some criteria or

但是,如果用户想要查看满足某些标准或任务目标的特定内容怎么办? 这就是通过 LLMs 进行指令调整发挥作用的地方。

![Base LLM Chat Completion](../../img/4.0-playground-chat-base.png?WT.mc_id=academic-105485-koreyst)
![Base LLM Chat Completion](../../images/04-playground-chat-base.png?WT.mc_id=academic-105485-koreyst)

### 概念: LLMs 中的指令调整

Expand All @@ -109,7 +109,7 @@ But what if the user wanted to see something specific that met some criteria or
看看现在如何调整结果以反映所需的目标和格式? 教育工作者现在可以直接在该课程的 ppt 中使用此结果。

![Instruction Tuned LLM Chat Completion](../../img/4.0-playground-chat-instructions.png?WT.mc_id=academic-105485-koreyst)
![Instruction Tuned LLM Chat Completion](../../images/04-playground-chat-instructions.png?WT.mc_id=academic-105485-koreyst)

## 为什么我们需要提示工程

Expand Down Expand Up @@ -138,15 +138,15 @@ But what if the user wanted to see something specific that met some criteria or

> **响应 1**: OpenAI Playground (GPT-35)
![Response 1](../../img/4.0-hallucination-oai.png?WT.mc_id=academic-105485-koreyst)
![Response 1](../../images/04-hallucination-oai.png?WT.mc_id=academic-105485-koreyst)

> **响应 2**: Azure OpenAI Playground (GPT-35)
![Response 2](../../img/4.0-hallucination-aoai.png?WT.mc_id=academic-105485-koreyst)
![Response 2](../../images/04-hallucination-aoai.png?WT.mc_id=academic-105485-koreyst)

> **响应 3**: : Hugging Face Chat Playground (LLama-2)
![Response 3](../../img/4.0-hallucination-huggingchat.png?WT.mc_id=academic-105485-koreyst)
![Response 3](../../images/04-hallucination-huggingchat.png?WT.mc_id=academic-105485-koreyst)

正如预期的那样,由于随机行为和模型能力变化,每个模型(或模型版本)都会产生略有不同的响应。 例如,一个模型针对八年级受众,而另一个模型则假设高中生。 但所有三个模型确实生成了可以让不知情的用户相信该事件是真实的响应

Expand Down
8 changes: 4 additions & 4 deletions 07-building-chat-applications/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Building Generative AI-Powered Chat Applications

[![Building Generative AI-Powered Chat Applications](./img/07-lesson-banner.png?WT.mc_id=academic-105485-koreyst)](https://youtu.be/Kw4i-tlKMrQ?WT.mc_id=academic-105485-koreyst)
[![Building Generative AI-Powered Chat Applications](./images/07-lesson-banner.png?WT.mc_id=academic-105485-koreyst)](https://youtu.be/Kw4i-tlKMrQ?WT.mc_id=academic-105485-koreyst)

> *(Click the image above to view video of this lesson)*
Expand Down Expand Up @@ -60,7 +60,7 @@ When building a chat application, a great first step is to assess what is alread
- **Easier maintenance**: Updates and improvements are easier to manage as most APIs and SDKs simply require an update to a library when a newer version is released.
- **Access to cutting edge technology**: Leveraging models that have been fined tuned and trained on extensive datasets provides your application with natural language capabilities.

Accessing functionality of an SDK or API typically involves obtaining permission to use the provided services, which is often through the use of a unique key or authentication token. We'll use the OpenAI Python Library to explore what this looks like. You can also try it out on your own in the [notebook](notebook.ipynb) for this lesson.
Accessing functionality of an SDK or API typically involves obtaining permission to use the provided services, which is often through the use of a unique key or authentication token. We'll use the OpenAI Python Library to explore what this looks like. You can also try it out on your own in the [notebook](./notebook.ipynb?WT.mc_id=academic-105485-koreyst) for this lesson.

```python
import os
Expand All @@ -87,11 +87,11 @@ General UX principles apply to chat applications, but here are some additional c

One such example of personalization is the "Custom instructions" settings in OpenAI's ChatGPT. It allows you to provide information about yourself that may be important context for your prompts. Here's an example of a custom instruction.

![Custom Instructions Settings in ChatGPT](img/custom_instructions.png)
![Custom Instructions Settings in ChatGPT](./images/custom-instructions.png?WT.mc_id=academic-105485-koreyst)

This "profile" prompts ChatGPT to create a lesson plan on linked lists. Notice that ChatGPT takes into account that the user may want a more in depth lesson plan based on her experience.

![A prompt in ChatGPT for a lesson plan about linked lists](img/lesson_plan_prompt.png)
![A prompt in ChatGPT for a lesson plan about linked lists](./images/lesson-plan-prompt.png?WT.mc_id=academic-105485-koreyst)

### Microsoft's System Message Framework for Large Language Models

Expand Down
8 changes: 4 additions & 4 deletions 07-building-chat-applications/translations/cn/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 第七章:创建聊天应用

[![Building Generative AI-Powered Chat Applications](../../img/07-lesson-banner.png?WT.mc_id=academic-105485-koreyst)](https://youtu.be/Kw4i-tlKMrQ?WT.mc_id=academic-105485-koreyst)
[![Building Generative AI-Powered Chat Applications](../../images/07-lesson-banner.png?WT.mc_id=academic-105485-koreyst)](https://youtu.be/Kw4i-tlKMrQ?WT.mc_id=academic-105485-koreyst)

> *(点击该图片看本章导学视频)*
Expand Down Expand Up @@ -62,7 +62,7 @@
- **更容易维护**:更新和改进更易于管理,因为大多数 API 和 SDK 在发布新版本时只需要更新库。
- **获得尖端技术**:利用经过微调和在广泛数据集上训练的模型为您的应用程序提供自然语言功能。

访问 SDK 或 API 的功能通常涉及获取使用所提供服务的许可,这通常是通过使用唯一 kwy 或身份验证 token 来实现的。 我们将使用 OpenAI Python library 来探索它是什么样子。 您也可以在本章的[notebook](notebook.ipynb) 中自行尝试。
访问 SDK 或 API 的功能通常涉及获取使用所提供服务的许可,这通常是通过使用唯一 kwy 或身份验证 token 来实现的。 我们将使用 OpenAI Python library 来探索它是什么样子。 您也可以在本章的[notebook](./notebook.ipynb?WT.mc_id=academic-105485-koreyst) 中自行尝试。


```python
Expand Down Expand Up @@ -90,11 +90,11 @@ AuthenticationError: No API key provided. You can set your API key in code using

个性化的一个例子是 OpenAI 的 ChatGPT 中的“自定义指令”设置。 它允许您提供有关您自己的信息,这些信息可能是您的提示的重要背景。 以下是自定义指令的示例。

![Custom Instructions Settings in ChatGPT](../../img/custom_instructions.png?WT.mc_id=academic-105485-koreyst)
![Custom Instructions Settings in ChatGPT](../../images/custom-instructions.png?WT.mc_id=academic-105485-koreyst)

“配置文件”提示 ChatGPT 在链接列表上创建课程计划。 请注意,ChatGPT 可以按照用户的特点获得更深入的课程计划。

![A prompt in ChatGPT for a lesson plan about linked lists](../../img/lesson_plan_prompt.png?WT.mc_id=academic-105485-koreyst)
![A prompt in ChatGPT for a lesson plan about linked lists](../../images/lesson-plan-prompt.png?WT.mc_id=academic-105485-koreyst)

### 微软的 LLMs 系统消息框架

Expand Down
6 changes: 3 additions & 3 deletions 08-building-search-applications/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Building a Search Applications

[![Introduction to Generative AI and Large Language Models](./media/genai_course_8[80].png?WT.mc_id=academic-105485-koreyst)](TBD)
[![Introduction to Generative AI and Large Language Models](./images/08-lesson-banner.png?WT.mc_id=academic-105485-koreyst)](TBD)

> **Video Coming Soon**
Expand Down Expand Up @@ -35,7 +35,7 @@ The lesson includes an Embedding Index of the YouTube transcripts for the Micros

The following is an example of a semantic query for the question 'can you use rstudio with azure ml?'. Check out the YouTube url, you'll see the url contains a timestamp that takes you to the place in the video where the answer to the question is located.

![Semantic query for the question "can you use rstudio with Azure ML"](./media/query_results.png?WT.mc_id=academic-105485-koreyst)
![Semantic query for the question "can you use rstudio with Azure ML"](./images/query-results.png?WT.mc_id=academic-105485-koreyst)

## What is semantic search?

Expand Down Expand Up @@ -154,7 +154,7 @@ Open the [solution notebook](./solution.ipynb?WT.mc_id=academic-105485-koreyst)

When you run the notebook, you'll be prompted to enter a query. The input box will look like this:

![Input box for the user to input a query](./media/notebook_search.png?WT.mc_id=academic-105485-koreyst)
![Input box for the user to input a query](./images/notebook-search.png?WT.mc_id=academic-105485-koreyst)

## Great Work! Continue Your Learning

Expand Down
6 changes: 3 additions & 3 deletions 08-building-search-applications/translations/cn/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 第八章:创建搜索应用

[![Introduction to Generative AI and Large Language Models](../../media/genai_course_8[80].png?WT.mc_id=academic-105485-koreyst)](TBD)
[![Introduction to Generative AI and Large Language Models](../../images/08-lesson-banner.png?WT.mc_id=academic-105485-koreyst)](TBD)

> **导学视频敬请期待**
Expand Down Expand Up @@ -35,7 +35,7 @@ LLMs 应用场景不仅仅是聊天机器人和文本生成。 还可以使用

以下是问题“can you use rstudio with azure ml?”的语义查询示例。 查看 YouTube 网址,您会看到该网址包含一个时间戳,可将您带到视频中问题答案所在的位置。

![Semantic query for the question "can you use rstudio with Azure ML"](../../media/query_results.png?WT.mc_id=academic-105485-koreyst)
![Semantic query for the question "can you use rstudio with Azure ML"](../../images/query-results.png?WT.mc_id=academic-105485-koreyst)

## 什么是语义搜索?

Expand Down Expand Up @@ -158,7 +158,7 @@ az cognitiveservices account deployment create \

当您运行 notebook 时,系统将提示您输入查询。 输入框将如下所示:

![Input box for the user to input a query](../../media/notebook_search.png?WT.mc_id=academic-105485-koreyst)
![Input box for the user to input a query](../../images/notebook-search.png?WT.mc_id=academic-105485-koreyst)

## 继续学习

Expand Down
14 changes: 7 additions & 7 deletions 09-building-image-applications/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Building Image Generation Applications

[![Building Image Generation Applications](./images/genai_course_9[70].png?WT.mc_id=academic-105485-koreyst)](TBD)
[![Building Image Generation Applications](./images/09-lesson-banner.png?WT.mc_id=academic-105485-koreyst)](TBD)

> **Video Coming Soon**
Expand Down Expand Up @@ -150,7 +150,7 @@ So what does it take to build an image generation application? You need the foll
os.mkdir(image_dir)
# Initialize the image path (note the filetype should be png)
image_path = os.path.join(image_dir, 'generated_image.png')
image_path = os.path.join(image_dir, 'generated-image.png')
# Retrieve the generated image
image_url = generation_response["data"][0]["url"] # extract image URL from response
Expand Down Expand Up @@ -282,11 +282,11 @@ Let's look at an example of how temperature works, by running this prompt twice:

> Prompt : "Bunny on horse, holding a lollipop, on a foggy meadow where it grows daffodils"

![Bunny on a horse holding a lollipop, version 1](./images/v1-generated_image.png?WT.mc_id=academic-105485-koreyst)
![Bunny on a horse holding a lollipop, version 1](./images/v1-generated-image.png?WT.mc_id=academic-105485-koreyst)

Now let's run that same prompt just to see that we won't get the same image twice:

![Generated image of bunny on horse](./images/v2-generated_image.png?WT.mc_id=academic-105485-koreyst)
![Generated image of bunny on horse](./images/v2-generated-image.png?WT.mc_id=academic-105485-koreyst)

As you can see, the images are similar, but not the same. Let's try changing the temperature value to 0.1 and see what happens:

Expand Down Expand Up @@ -315,8 +315,8 @@ generation_response = openai.Image.create(

Now when you run this code, you get these two images:

- ![Temperature 0, v1](./images/v1-0temp-generated_image.png?WT.mc_id=academic-105485-koreyst)
- ![Temperature 0 , v2](./images/v2-0temp-generated_image.png?WT.mc_id=academic-105485-koreyst)
- ![Temperature 0, v1](./images/v1-temp-generated-image.png?WT.mc_id=academic-105485-koreyst)
- ![Temperature 0 , v2](./images/v2-temp-generated-image.png?WT.mc_id=academic-105485-koreyst)

Here you can clearly see how the images resemble each other more.

Expand Down Expand Up @@ -443,7 +443,7 @@ try:
os.mkdir(image_dir)

# Initialize the image path (note the filetype should be png)
image_path = os.path.join(image_dir, 'generated_image.png')
image_path = os.path.join(image_dir, 'generated-image.png')

# Retrieve the generated image
image_url = generation_response["data"][0]["url"] # extract image URL from response
Expand Down
4 changes: 2 additions & 2 deletions 09-building-image-applications/app-variation.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
image_dir = os.path.join(os.curdir, 'images')

# Initialize the image path (note the filetype should be png)
image_path = os.path.join(image_dir, 'generated_image.png')
image_path = os.path.join(image_dir, 'generated-image.png')

# ---creating variation below---
try:
print("LOG creating variation")
response = openai.Image.create_variation(
image=open("generated_image.png", "rb"),
image=open("generated-image.png", "rb"),
n=1,
size="1024x1024"
)
Expand Down
2 changes: 1 addition & 1 deletion 09-building-image-applications/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
os.mkdir(image_dir)

# Initialize the image path (note the filetype should be png)
image_path = os.path.join(image_dir, 'generated_image.png')
image_path = os.path.join(image_dir, 'generated-image.png')

# Retrieve the generated image
image_url = generation_response["data"][0]["url"] # extract image URL from response
Expand Down
Loading

0 comments on commit d354f7b

Please sign in to comment.