Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
schorndorfer committed Nov 14, 2023
1 parent 8e43440 commit a73ea85
Show file tree
Hide file tree
Showing 13 changed files with 96 additions and 303 deletions.
54 changes: 32 additions & 22 deletions _sources/speech-to-text.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 32,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -91,7 +91,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 33,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -229,9 +229,19 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 34,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...\n",
"To disable this warning, you can either:\n",
"\t- Avoid using `tokenizers` before the fork if possible\n",
"\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
Expand Down Expand Up @@ -266,7 +276,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 35,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -298,7 +308,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 36,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -336,7 +346,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 37,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -360,7 +370,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 38,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -373,7 +383,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 39,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -415,7 +425,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 40,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -438,7 +448,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 41,
"metadata": {},
"outputs": [
{
Expand All @@ -459,7 +469,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 42,
"metadata": {},
"outputs": [
{
Expand All @@ -480,7 +490,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 43,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -512,7 +522,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 44,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -529,7 +539,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 45,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -576,7 +586,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 46,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -600,7 +610,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 47,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -634,7 +644,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 48,
"metadata": {},
"outputs": [
{
Expand All @@ -643,7 +653,7 @@
"'ہم دنیا کو چاکلٹ سے مسکراتے ہوئے بناتے ہیں۔'"
]
},
"execution_count": 26,
"execution_count": 48,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -663,7 +673,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 49,
"metadata": {},
"outputs": [
{
Expand All @@ -672,7 +682,7 @@
"'हम दुन्या को चौकलेट से मुस्कराते हुए बनाते हैं।'"
]
},
"execution_count": 39,
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -690,7 +700,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 50,
"metadata": {},
"outputs": [
{
Expand All @@ -699,7 +709,7 @@
"'ہم دنیا کو چاکولیٹ سے مسکراتے ہوئے بناتے ہیں'"
]
},
"execution_count": 27,
"execution_count": 50,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
2 changes: 2 additions & 0 deletions _sources/takeaways.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Summary and Takeaways

:::{admonition} Summary
:class: note
- Setting up an OpenAI account
Expand Down
12 changes: 6 additions & 6 deletions analyze-text.html

Large diffs are not rendered by default.

24 changes: 11 additions & 13 deletions augmented-generation.html
Original file line number Diff line number Diff line change
Expand Up @@ -526,30 +526,28 @@ <h2><em>Example A: Retrieving Updated Selenium Syntax</em><a class="headerlink"
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Answer: In the latest version of Python Selenium, you can find an element by class name using the `find_element_by_class_name` method.

Here&#39;s an example of how you can do this:
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Answer: In the latest version of Python Selenium, you can find an element by class name using the `find_element_by_class_name` method of the WebDriver object. Here&#39;s an example of how to do this:

```python
from selenium import webdriver

# Launch the web browser
driver = webdriver.Chrome()
# Create a new instance of the Firefox driver
driver = webdriver.Firefox()

# Navigate to a webpage
driver.get(&quot;https://example.com&quot;)
# Navigate to a web page
driver.get(&quot;https://www.example.com&quot;)

# Find the element by class name
# Find an element by its class name
element = driver.find_element_by_class_name(&quot;example-class&quot;)

# Perform actions with the element
element.click()
# Do something with the element, for example, print its text
print(element.text)

# Close the web browser
# Close the browser
driver.quit()
```

In this example, the `find_element_by_class_name` method is used to locate an element with the class name &quot;example-class&quot; on the webpage. You can then perform any actions you need with the located element.
In this example, the `find_element_by_class_name` method is used to locate an element on the web page by its class name. You can then perform various operations on the located element, such as getting its text, clicking it, or interacting with it in other ways.
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -684,7 +682,7 @@ <h2><em>Example B: Preventing Hallucinations</em><a class="headerlink" href="#ex
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Answer: I&#39;m afraid there&#39;s been a misunderstanding. No elephant has ever been sent to or landed on the moon. As far as we know, the only living creatures that have been sent to the Moon are humans and a few types of microorganisms. The Apollo missions, conducted by NASA, sent a total of 12 astronauts to the moon between 1969 and 1972.
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Answer: I&#39;m sorry, but there seems to be a misunderstanding. No elephant has ever landed on the moon. Only human astronauts, spearheaded by the United States&#39; NASA Apollo program, have actually set foot on the moon. The first of these was Neil Armstrong on July 20, 1969.
</pre></div>
</div>
</div>
Expand Down
10 changes: 7 additions & 3 deletions function-calling.html
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ <h2>Flight Status Query Project<a class="headerlink" href="#flight-status-query-
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>ChatCompletion(id=&#39;chatcmpl-8KfqGwDyadqAa3nIqRmEfy7t0UZaV&#39;, choices=[Choice(finish_reason=&#39;function_call&#39;, index=0, message=ChatCompletionMessage(content=None, role=&#39;assistant&#39;, function_call=FunctionCall(arguments=&#39;{\n &quot;airline_code&quot;: &quot;UA&quot;,\n &quot;flight_number&quot;: 792,\n &quot;day&quot;: 12,\n &quot;month&quot;: 11,\n &quot;year&quot;: 2023\n}&#39;, name=&#39;get_flight_status&#39;), tool_calls=None))], created=1699938092, model=&#39;gpt-3.5-turbo-0613&#39;, object=&#39;chat.completion&#39;, system_fingerprint=None, usage=CompletionUsage(completion_tokens=48, prompt_tokens=119, total_tokens=167))
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>ChatCompletion(id=&#39;chatcmpl-8Kg4GYz8z65SbGFjajVYg1EKVb9tb&#39;, choices=[Choice(finish_reason=&#39;function_call&#39;, index=0, message=ChatCompletionMessage(content=None, role=&#39;assistant&#39;, function_call=FunctionCall(arguments=&#39;{\n &quot;airline_code&quot;: &quot;UA&quot;,\n &quot;flight_number&quot;: 792,\n &quot;day&quot;: 12,\n &quot;month&quot;: 11,\n &quot;year&quot;: 2023\n}&#39;, name=&#39;get_flight_status&#39;), tool_calls=None))], created=1699938960, model=&#39;gpt-3.5-turbo-0613&#39;, object=&#39;chat.completion&#39;, system_fingerprint=None, usage=CompletionUsage(completion_tokens=48, prompt_tokens=119, total_tokens=167))
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -624,7 +624,7 @@ <h2>Flight Status Query Project<a class="headerlink" href="#flight-status-query-
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>ChatCompletion(id=&#39;chatcmpl-8KfqHyDfDMuDSSUbME9IV0ZJYjZX5&#39;, choices=[Choice(finish_reason=&#39;stop&#39;, index=0, message=ChatCompletionMessage(content=&#39;The flight status of UA 792 for Nov 12, 2023 is on time. The flight is scheduled to depart at 06:00 CST and arrive at 09:06 EST.&#39;, role=&#39;assistant&#39;, function_call=None, tool_calls=None))], created=1699938093, model=&#39;gpt-3.5-turbo-0613&#39;, object=&#39;chat.completion&#39;, system_fingerprint=None, usage=CompletionUsage(completion_tokens=41, prompt_tokens=150, total_tokens=191))
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>ChatCompletion(id=&#39;chatcmpl-8Kg4H4YWhirFyHPcTySlk60gUzekZ&#39;, choices=[Choice(finish_reason=&#39;stop&#39;, index=0, message=ChatCompletionMessage(content=&#39;The flight status of UA 792 for November 12, 2023 is as follows: \n\n- On time\n- Departing at 06:00 CST\n- Arriving at 09:06 EST&#39;, role=&#39;assistant&#39;, function_call=None, tool_calls=None))], created=1699938961, model=&#39;gpt-3.5-turbo-0613&#39;, object=&#39;chat.completion&#39;, system_fingerprint=None, usage=CompletionUsage(completion_tokens=44, prompt_tokens=150, total_tokens=194))
</pre></div>
</div>
</div>
Expand All @@ -639,7 +639,11 @@ <h2>Flight Status Query Project<a class="headerlink" href="#flight-status-query-
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The flight status of UA 792 for Nov 12, 2023 is on time. The flight is scheduled to depart at 06:00 CST and arrive at 09:06 EST.
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The flight status of UA 792 for November 12, 2023 is as follows:

- On time
- Departing at 06:00 CST
- Arriving at 09:06 EST
</pre></div>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@
<li class="toctree-l1"><a class="reference internal" href="fine-tuning.html">Fine-Tuning</a></li>
<li class="toctree-l1"><a class="reference internal" href="langchain.html">Creating Applications with Langchain</a></li>
<li class="toctree-l1"><a class="reference internal" href="augmented-generation.html">Retrieval Augmented Generation</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Summary</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="takeaways.html">Summary and Takeaways</a></li>
</ul>

</div>
Expand Down
Binary file modified objects.inv
Binary file not shown.
4 changes: 4 additions & 0 deletions search.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@
<li class="toctree-l1"><a class="reference internal" href="fine-tuning.html">Fine-Tuning</a></li>
<li class="toctree-l1"><a class="reference internal" href="langchain.html">Creating Applications with Langchain</a></li>
<li class="toctree-l1"><a class="reference internal" href="augmented-generation.html">Retrieval Augmented Generation</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Summary</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="takeaways.html">Summary and Takeaways</a></li>
</ul>

</div>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions setting-up-openai.html
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ <h2>API<a class="headerlink" href="#api" title="Permalink to this heading">#</a>
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>ChatCompletion(id=&#39;chatcmpl-8KfqMt7XSL5E7MXxR6w6FNbKPrvDD&#39;, choices=[Choice(finish_reason=&#39;length&#39;, index=0, message=ChatCompletionMessage(content=&quot;As a lion tamer with extensive knowledge in zoology and large cat psychology, being in the same room as a lion is a profound mix of exhilaration, respect, and careful calculation. My academic background and practical experience help me understand lion behavior, which is crucial for safe interactions. Here&#39;s an overview of what it&#39;s like:\n\n1. **Respect for Power and Wild Instincts**: Lions are apex predators with enormous strength and powerful instincts. When sharing a space with one, you&#39;re constantly reminded of their capability and natural behaviors. There&#39;s a deep admiration for the animal, paired with an understanding that it must always be respected and never underestimated.\n\n2. **Heightened Senses**: Your senses are heightened as you stay attuned to the lion&#39;s every move and sound. You watch for subtle cues in body language, facial expressions, and vocalizations that might indicate its mood and intentions.\n\n3. **Communication**: As an expert in large cat psychology, I can somewhat &#39;speak their language&#39; through body posture, eye contact, and other non-verbal cues. This creates a form of mutual communication that is essential in maintaining control and showing confidence.\n\n4. **Trust and Relationship**: Building a relationship based on trust and consistency is key. Over time, you&quot;, role=&#39;assistant&#39;, function_call=None, tool_calls=None))], created=1699938098, model=&#39;gpt-4-1106-preview&#39;, object=&#39;chat.completion&#39;, system_fingerprint=&#39;fp_a24b4d720c&#39;, usage=CompletionUsage(completion_tokens=256, prompt_tokens=53, total_tokens=309))
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>ChatCompletion(id=&#39;chatcmpl-8Kg4MBIfrnWpbZdpsWV9xjH4P3lvB&#39;, choices=[Choice(finish_reason=&#39;length&#39;, index=0, message=ChatCompletionMessage(content=&quot;As a lion tamer with extensive knowledge in zoology and large cat psychology, being in the same room as a lion is a profound mix of exhilaration, respect, and careful calculation. Each interaction with a lion, regardless of my expertise, requires a deep understanding of lion behavior, meticulous attention to safety protocols, and a profound respect for the animal&#39;s power and natural instincts.\n\nHere&#39;s an insight into what it&#39;s like to be in the same space as one of these majestic creatures:\n\n**Sensory Experience:**\n- **Visual:** Lions are visually impressive creatures; their size, strength, and beauty are awe-inspiring. Adult males boast a magnificent mane that frames their face and adds to their imposing presence.\n- **Auditory:** The sounds a lion makes—whether it&#39;s a low growl, a purr, or a deafening roar—can resonate in your chest and serve as a constant reminder of their power.\n- **Olfactory:** Lions have a distinctive smell, a musky odor that can be noticeable in an enclosed space.\n\n**Emotional Response:**\n- **Admiration:** Awe at the lion&#39;s beauty and physical presence is often one of the first emotional reactions.\n- **Fear and Respect:** A natural fear resonates from&quot;, role=&#39;assistant&#39;, function_call=None, tool_calls=None))], created=1699938966, model=&#39;gpt-4-1106-preview&#39;, object=&#39;chat.completion&#39;, system_fingerprint=&#39;fp_a24b4d720c&#39;, usage=CompletionUsage(completion_tokens=256, prompt_tokens=53, total_tokens=309))
</pre></div>
</div>
</div>
Expand All @@ -553,15 +553,18 @@ <h2>API<a class="headerlink" href="#api" title="Permalink to this heading">#</a>
</div>
</details>
</div>
<p><span class="pasted-text">As a lion tamer with extensive knowledge in zoology and large cat psychology, being in the same room as a lion is a profound mix of exhilaration, respect, and careful calculation. My academic background and practical experience help me understand lion behavior, which is crucial for safe interactions. Here’s an overview of what it’s like:
<p><span class="pasted-text">As a lion tamer with extensive knowledge in zoology and large cat psychology, being in the same room as a lion is a profound mix of exhilaration, respect, and careful calculation. Each interaction with a lion, regardless of my expertise, requires a deep understanding of lion behavior, meticulous attention to safety protocols, and a profound respect for the animal’s power and natural instincts.

1. **Respect for Power and Wild Instincts**: Lions are apex predators with enormous strength and powerful instincts. When sharing a space with one, you’re constantly reminded of their capability and natural behaviors. There’s a deep admiration for the animal, paired with an understanding that it must always be respected and never underestimated.
Here’s an insight into what it’s like to be in the same space as one of these majestic creatures:

2. **Heightened Senses**: Your senses are heightened as you stay attuned to the lion’s every move and sound. You watch for subtle cues in body language, facial expressions, and vocalizations that might indicate its mood and intentions.
**Sensory Experience:**
- **Visual:** Lions are visually impressive creatures; their size, strength, and beauty are awe-inspiring. Adult males boast a magnificent mane that frames their face and adds to their imposing presence.
- **Auditory:** The sounds a lion makes—whether it’s a low growl, a purr, or a deafening roar—can resonate in your chest and serve as a constant reminder of their power.
- **Olfactory:** Lions have a distinctive smell, a musky odor that can be noticeable in an enclosed space.

3. **Communication**: As an expert in large cat psychology, I can somewhat ‘speak their language’ through body posture, eye contact, and other non-verbal cues. This creates a form of mutual communication that is essential in maintaining control and showing confidence.

4. **Trust and Relationship**: Building a relationship based on trust and consistency is key. Over time, you</span></p>
**Emotional Response:**
- **Admiration:** Awe at the lion’s beauty and physical presence is often one of the first emotional reactions.
- **Fear and Respect:** A natural fear resonates from</span></p>
<div class="admonition-usage-https-platform-openai-com-usage admonition">
<p class="admonition-title"><a class="reference external" href="https://platform.openai.com/usage">Usage</a></p>
<figure class="align-default" id="openai-billing">
Expand Down
Loading

0 comments on commit a73ea85

Please sign in to comment.