Link to article about generators

!stable-docs
This commit is contained in:
Simon Willison 2023-11-12 08:13:59 -08:00 committed by GitHub
parent e9a6998ca3
commit df7d24835b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -137,7 +137,7 @@ To execute the model, we start with a word. We look at the options for words tha
Some words might not have any following words from our training sentence. For our implementation we wil fall back on picking a random word from our collection.
We will implement this as a [Python generator], using the yield keyword to produce each token:
We will implement this as a [Python generator](https://realpython.com/introduction-to-python-generators/), using the yield keyword to produce each token:
```python
def generate(transitions, length, start_word=None):
all_words = list(transitions.keys())
@ -578,4 +578,4 @@ You may find that you are unable to uninstall the plugin using `llm uninstall ll
Should this happen, you can uninstall the plugin after first disabling it using the {ref}`LLM_LOAD_PLUGINS <llm-load-plugins>` environment variable like this:
```bash
LLM_LOAD_PLUGINS='' llm uninstall llm-markov
```
```