Fix typos and improve docs
This commit is contained in:
parent
1f08f94684
commit
9999b7ef29
9 changed files with 29 additions and 31 deletions
|
|
@ -56,7 +56,7 @@ As you can see, everything worked as expected. There is one way to improve it th
|
||||||
Let's send multiple requests at the same time to speed up the overall execution time. To do this, we will use the [call_remote_great_ai_async][great_ai.call_remote_great_ai_async] function.
|
Let's send multiple requests at the same time to speed up the overall execution time. To do this, we will use the [call_remote_great_ai_async][great_ai.call_remote_great_ai_async] function.
|
||||||
|
|
||||||
??? note "Why is this possible?"
|
??? note "Why is this possible?"
|
||||||
Note, that in `server.py`, the inference function is declared `async`. This means that multiple "copies" of it can run at the same time in the same thread. Since, there is no CPU-bottleneck, the server has a quite large throughpout (requests responded to per second), but its latency will stay around 2 seconds due to the async `sleep` command.
|
Note, that in `server.py`, the inference function is declared `async`. This means that multiple "copies" of it can run at the same time in the same thread. Since, there is no CPU bottleneck, the server has a quite large throughput (requests responded to per second), but its latency will stay around 2 seconds due to the async `sleep` command.
|
||||||
|
|
||||||
If your great-ai server is not `async`, higher throughput can be achieved by running multiple instances of it, either manually, or by running it with multiple `uvicorn` workers like this: `ENVIRONMENT=production great-ai server.py --worker_count 4`
|
If your great-ai server is not `async`, higher throughput can be achieved by running multiple instances of it, either manually, or by running it with multiple `uvicorn` workers like this: `ENVIRONMENT=production great-ai server.py --worker_count 4`
|
||||||
|
|
||||||
|
|
@ -88,4 +88,4 @@ asyncio.run(main())
|
||||||
|
|
||||||
{ loading=lazy }
|
{ loading=lazy }
|
||||||
|
|
||||||
This also works, and in some use cases might be considerably quicker.
|
This also works, and in some use-cases might be considerably quicker.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# How to configure GreatAI
|
# How to configure GreatAI
|
||||||
|
|
||||||
GreatAI aims to provide reasonable defaults wherever possible. The current configuration is always prominently displayed (and updated) on the dashboard and in the command-line startup banner.
|
GreatAI aims to provide reasonable defaults wherever possible. The current configuration is always prominently displayed (and updated) on the dashboard and in the command-line start-up banner.
|
||||||
|
|
||||||
## Using [great_ai.configure][]
|
## Using [great_ai.configure][]
|
||||||
|
|
||||||
|
|
@ -37,7 +37,7 @@ The only aspect that cannot be automated is choosing the backing storage for the
|
||||||
|
|
||||||
Right now, you have 3 options for storing the models and large datasets: [LargeFileLocal][great_ai.large_file.LargeFileLocal], [LargeFileMongo][great_ai.large_file.LargeFileMongo], and [LargeFileS3][great_ai.large_file.LargeFileS3].
|
Right now, you have 3 options for storing the models and large datasets: [LargeFileLocal][great_ai.large_file.LargeFileLocal], [LargeFileMongo][great_ai.large_file.LargeFileMongo], and [LargeFileS3][great_ai.large_file.LargeFileS3].
|
||||||
|
|
||||||
Without explicit configuration, [LargeFileLocal][great_ai.large_file.LargeFileLocal] is selected by default. This one still version-controls your files but it only stores them in a local path.
|
Without explicit configuration, [LargeFileLocal][great_ai.large_file.LargeFileLocal] is selected by default. This one still version-controls your files but it only stores them in a local path (which of course can be a remote volume attached by [NFS](https://en.wikipedia.org/wiki/Network_File_System){ target=_blank }, [HDFS](https://hadoop.apache.org/docs/r1.2.1/hdfs_design.html){ target=_blank }, etc.).
|
||||||
|
|
||||||
!!! important
|
!!! important
|
||||||
If your working directory contains a `mongo.ini` or `s3.ini` file, an attempt is made to auto-configure [LargeFileMongo][great_ai.large_file.LargeFileMongo] or [LargeFileS3][great_ai.large_file.LargeFileS3] respectively.
|
If your working directory contains a `mongo.ini` or `s3.ini` file, an attempt is made to auto-configure [LargeFileMongo][great_ai.large_file.LargeFileMongo] or [LargeFileS3][great_ai.large_file.LargeFileS3] respectively.
|
||||||
|
|
@ -63,7 +63,7 @@ model = [4, 3]
|
||||||
save_model(model, 'my-model')
|
save_model(model, 'my-model')
|
||||||
```
|
```
|
||||||
|
|
||||||
1. This line isn't strictly necceseary because if `s3.ini` (or `mongo.ini`) is available in the current working directory, they are automatically used to configure their respective LargeFile implementations/databases.
|
1. This line isn't strictly necessary because if `s3.ini` (or `mongo.ini`) is available in the current working directory, they are automatically used to configure their respective LargeFile implementations/databases.
|
||||||
|
|
||||||
??? note "Departing from AWS"
|
??? note "Departing from AWS"
|
||||||
With the `aws_endpoint_url` argument, it is possible to use any other S3-compatible service such as [Backblaze](https://www.backblaze.com/){ target=_blank }. In that case, it would be `aws_endpoint_url=https://s3.us-west-002.backblazeb2.com`.
|
With the `aws_endpoint_url` argument, it is possible to use any other S3-compatible service such as [Backblaze](https://www.backblaze.com/){ target=_blank }. In that case, it would be `aws_endpoint_url=https://s3.us-west-002.backblazeb2.com`.
|
||||||
|
|
@ -99,4 +99,4 @@ By default, a thread-safe version of [TinyDB](https://tinydb.readthedocs.io/en/l
|
||||||
|
|
||||||
### MongoDB
|
### MongoDB
|
||||||
|
|
||||||
At the moment, only MongoDB is supported as a production-ready `TracingDatabase`. In order to use it, you have to either place a file named `mongo.ini` in your working directory, or explicitly call [MongoDbDriver.configure_credentials_from_file][great_ai.MongoDbDriver] or [MongoDbDriver.configure_credentials][great_ai.MongoDbDriver.configure_credentials].
|
At the moment, only MongoDB is supported as a production-ready `TracingDatabase`. In order to use it, you have to either place a file named `mongo.ini` in your working directory, or explicitly call either [MongoDbDriver.configure_credentials_from_file][great_ai.MongoDbDriver] or [MongoDbDriver.configure_credentials][great_ai.MongoDbDriver.configure_credentials].
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ def greeter(your_name):
|
||||||
```
|
```
|
||||||
|
|
||||||
??? info "Why not simply use `@GreatAI?`"
|
??? info "Why not simply use `@GreatAI?`"
|
||||||
The purpose of the [@GreatAI.create][great_ai.GreatAI.create] is simply to provide you with type-checking through MyPy, Pylance, and similar libraries. However, the overloading support for `__new__` is lacking in MyPy, thus, a static factory method is used instead.
|
The purpose of [@GreatAI.create][great_ai.GreatAI.create] is simply to provide you with type-checking through MyPy, Pylance, and similar libraries. However, the overloading support for `__new__` is lacking in MyPy, thus, a static factory method is used instead.
|
||||||
|
|
||||||
## With types
|
## With types
|
||||||
|
|
||||||
|
|
@ -46,13 +46,13 @@ from asyncio import sleep
|
||||||
|
|
||||||
@GreatAI.create
|
@GreatAI.create
|
||||||
async def async_greeter(your_name: str) -> str:
|
async def async_greeter(your_name: str) -> str:
|
||||||
await sleep(2) # simulate IO-heavy operation
|
await sleep(2) # simulate IO-bound operation
|
||||||
return f'Hi {your_name}!'
|
return f'Hi {your_name}!'
|
||||||
```
|
```
|
||||||
|
|
||||||
## With decorators
|
## With decorators
|
||||||
|
|
||||||
GreatAI can decorate already decorated functions. The only restriction is that [@GreatAI.create][great_ai.GreatAI.create] always has to come last. There are two built-in decorators that you can use to customise your function but you can you use any third-party decorator as well.
|
GreatAI can decorate already decorated functions. The only restriction is that [@GreatAI.create][great_ai.GreatAI.create] must come last. There are two built-in decorators that you can use to customise your function but you can you use any third-party decorator as well.
|
||||||
|
|
||||||
### Using `@use_model`
|
### Using `@use_model`
|
||||||
|
|
||||||
|
|
@ -72,7 +72,7 @@ assert type_safe_greeter('Andras').output == 'Hi Andras'
|
||||||
1. By default, the parameter named `model` will be replaced by the loaded model. This behaviour can be customised by setting the `model_kwarg_name`. This way, even multiple models can be injected into a single function.
|
1. By default, the parameter named `model` will be replaced by the loaded model. This behaviour can be customised by setting the `model_kwarg_name`. This way, even multiple models can be injected into a single function.
|
||||||
|
|
||||||
!!! important
|
!!! important
|
||||||
You must call [@use_model][great_ai.use_model] before [@GreatAI.create][great_ai.GreatAI.create]. Feel free to use [@use_model][great_ai.use_model] in other places of the codebase, it works equally well outside of GreatAI services.
|
You must call [@use_model][great_ai.use_model] before [@GreatAI.create][great_ai.GreatAI.create]. Note, that decorators are applied starting from the bottom-most one. Feel free to use [@use_model][great_ai.use_model] in other places of the codebase, it works equally well outside of GreatAI services.
|
||||||
|
|
||||||
### Using `@parameter`
|
### Using `@parameter`
|
||||||
|
|
||||||
|
|
@ -93,7 +93,7 @@ assert type_safe_greeter('Andras').output == 'Hi Andras'
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! important
|
!!! important
|
||||||
You must call [@parameter][great_ai.parameter] before [@GreatAI.create][great_ai.GreatAI.create]. Feel free to use [@parameter][great_ai.parameter] in other places of the codebase, it works equally well outside of GreatAI services.
|
You must call [@parameter][great_ai.parameter] before [@GreatAI.create][great_ai.GreatAI.create]. Note, that decorators are applied starting from the bottom-most one. Feel free to use [@parameter][great_ai.parameter] in other places of the codebase, it works equally well outside of GreatAI services.
|
||||||
|
|
||||||
## Complex example
|
## Complex example
|
||||||
|
|
||||||
|
|
@ -117,4 +117,4 @@ def add_number(positive_number: int, secret: int) -> int:
|
||||||
assert add_number(1).output == 5
|
assert add_number(1).output == 5
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Refer to [storing models](/how-to-guides/store-models) for specifying where to store your models.
|
1. Refer to [the configuration page](/how-to-guides/configure-service) for specifying where to store your models.
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ In order to simplify your training data management, `great-ai` provide two compl
|
||||||
At the start of your experiments' first iteration, after you've gathered suitable samples for training, you can call [great_ai.add_ground_truth][]. This automatically stores a timestamp and also allows you to assign tags to the data. Using these attributes, [great_ai.query_ground_truth][] can be called to get a filtered view of the training data.
|
At the start of your experiments' first iteration, after you've gathered suitable samples for training, you can call [great_ai.add_ground_truth][]. This automatically stores a timestamp and also allows you to assign tags to the data. Using these attributes, [great_ai.query_ground_truth][] can be called to get a filtered view of the training data.
|
||||||
|
|
||||||
!!! important "Train-test-validation splits"
|
!!! important "Train-test-validation splits"
|
||||||
It is a best-practice to lock-away a test split of your data that is only used for the final quality assessment. This prevents you from accidentally training on it, or inadvertently tuning the model to have the highest accuracy metrics on the test split. This, of course, may lead to dubious results, hence, care must be taken to avoid it.
|
It is a best-practice to lock-away the test split of your data that is only used for the final quality assessment. This prevents you from accidentally training on it, or inadvertently tuning the model to have the highest accuracy metrics on the test split. This, of course, may lead to dubious results, hence, care must be taken to avoid it.
|
||||||
|
|
||||||
With [great_ai.add_ground_truth][], there is an option to tag the samples with `train`, `test`, and `validation` randomly, following a predefined distribution. This happens as soon as they're written in the database. Later on, these can be queried by providing the name of the appropriate tags.
|
With [great_ai.add_ground_truth][], there is an option to tag the samples with `train`, `test`, and `validation` randomly, following a predefined distribution. This happens as soon as they're written in the database. Later, these can be queried by providing the name of the appropriate tags.
|
||||||
|
|
||||||
The nice thing about this is that the 'input-expected output' pairs are stored as traces. Thus, they behave exactly like regular prediction traces.
|
The nice thing about this is that the 'input-expected output' pairs are stored as traces. Thus, they behave exactly like regular prediction traces.
|
||||||
|
|
||||||
|
|
@ -52,7 +52,7 @@ add_ground_truth(
|
||||||
|
|
||||||
1. Expected output. This can be also accessed through the `.output` property.
|
1. Expected output. This can be also accessed through the `.output` property.
|
||||||
2. The input value is stored here.
|
2. The input value is stored here.
|
||||||
3. Notice how `ground_truth` always included as a tag when using [great_ai.add_ground_truth][].
|
3. Notice how `ground_truth` is always included as a tag when using [great_ai.add_ground_truth][].
|
||||||
|
|
||||||
## Get feedback
|
## Get feedback
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# How to use LargeFile-s
|
# How to use LargeFiles
|
||||||
|
|
||||||
The functions [save_model][great_ai.use_model] and [@use_model][great_ai.use_model] wrap LargeFile instances. Hence, besides configuring LargeFile, users have few reasons to use LargeFile-s directly.
|
The functions [save_model][great_ai.use_model] and [@use_model][great_ai.use_model] wrap LargeFile instances. Hence, besides configuring [LargeFile](/reference/large-file), users have few reasons to use LargeFiles directly.
|
||||||
|
|
||||||
## Motivation
|
## Motivation
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@ Oftentimes, especially when working with data-heavy applications, large files ca
|
||||||
for i in range(100000):
|
for i in range(100000):
|
||||||
f.write('test\n')
|
f.write('test\n')
|
||||||
|
|
||||||
# By default the latest version is returned
|
# The latest version is returned by default
|
||||||
# but an optional `version` keyword argument can be provided as well
|
# but an optional `version` keyword argument can be provided as well
|
||||||
with LargeFileS3("test.txt", "r") as f: #(1)
|
with LargeFileS3("test.txt", "r") as f: #(1)
|
||||||
print(f.readlines()[0])
|
print(f.readlines()[0])
|
||||||
|
|
@ -39,7 +39,7 @@ Oftentimes, especially when working with data-heavy applications, large files ca
|
||||||
|
|
||||||
### More details
|
### More details
|
||||||
|
|
||||||
`LargeFile` behaves like an opened file (in the background it is a temp file after all). Binary reads and writes are supported along with the [different keywords `open()` accepts](https://docs.python.org/3/library/functions.html#open).
|
`LargeFile` behaves like an opened file (in the background it is a temp file after all). Binary reads and writes are supported along with the [different keywords `open()` accepts](https://docs.python.org/3/library/functions.html#open){ target=_blank }.
|
||||||
|
|
||||||
The local cache can be configured with these properties:
|
The local cache can be configured with these properties:
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@ Oftentimes, especially when working with data-heavy applications, large files ca
|
||||||
|
|
||||||
#### I only need a path
|
#### I only need a path
|
||||||
|
|
||||||
In case you only need a path to the "remote" file, this pattern can be applied:
|
In case you only need a path to the (proxy of the) remote file, this pattern can be applied:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
path_to_model = LargeFileS3("folder-of-my-bert-model", version=31).get()
|
path_to_model = LargeFileS3("folder-of-my-bert-model", version=31).get()
|
||||||
|
|
@ -66,7 +66,7 @@ Oftentimes, especially when working with data-heavy applications, large files ca
|
||||||
|
|
||||||
> This way both regular files and folders can be handled. The uploaded file is called **folder-of-my-bert-model**, the local name is ignored.
|
> This way both regular files and folders can be handled. The uploaded file is called **folder-of-my-bert-model**, the local name is ignored.
|
||||||
|
|
||||||
Lastly, all version of the remote object can be deleted by calling `LargeFileS3("my-file").delete()`. It will still reside in your local cache afterwards, its deletion will happen next time your local cache has to be pruned.
|
Lastly, all version of the remote object can be deleted by calling `LargeFileS3("my-file").delete()`. It will still reside in your local cache afterwards; its deletion will happen next time your local cache has to be pruned.
|
||||||
|
|
||||||
## From the command-line
|
## From the command-line
|
||||||
|
|
||||||
|
|
@ -93,7 +93,7 @@ large-file --backend s3 --secrets secrets.ini \
|
||||||
> Only the filename is used as the S3 name, the rest of the path is ignored.
|
> Only the filename is used as the S3 name, the rest of the path is ignored.
|
||||||
|
|
||||||
!!! important "Using MongoDB"
|
!!! important "Using MongoDB"
|
||||||
The possible values for `--backend` are `s3`, `mongo`, and `local`. The latter doesn't need credentials, it only versions and stores your files in a local folder. MongoDB on the other hand requires a `mongo_connection_string` and a `mongo_database` to be specified. For storing large files, it uses the GridFS specification.
|
The possible values for `--backend` are `s3`, `mongo`, and `local`. The latter doesn't need credentials, it only versions and stores your files in a local folder. MongoDB on the other hand requires a `mongo_connection_string` and a `mongo_database` to be specified. For storing large files, it uses the [GridFS](https://www.mongodb.com/docs/manual/core/gridfs){ target=_blank } specification.
|
||||||
|
|
||||||
### Download some files to the local cache
|
### Download some files to the local cache
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ from great_ai import GreatAI
|
||||||
|
|
||||||
@GreatAI.create
|
@GreatAI.create
|
||||||
def greeter(your_name: str) -> str:
|
def greeter(your_name: str) -> str:
|
||||||
return f'Hi {your_name}'
|
return f'Hi {your_name}!'
|
||||||
```
|
```
|
||||||
|
|
||||||
## One-off prediction
|
## One-off prediction
|
||||||
|
|
@ -24,7 +24,7 @@ Trace[str]({'created': '2022-07-11T14:31:46.183764',
|
||||||
'logged_values': {'arg:your_name:length': 3, 'arg:your_name:value': 'Bob'},
|
'logged_values': {'arg:your_name:length': 3, 'arg:your_name:value': 'Bob'},
|
||||||
'models': [],
|
'models': [],
|
||||||
'original_execution_time_ms': 0.0381,
|
'original_execution_time_ms': 0.0381,
|
||||||
'output': 'Hi Bob',
|
'output': 'Hi Bob!',
|
||||||
'tags': ['greeter', 'online', 'development'],
|
'tags': ['greeter', 'online', 'development'],
|
||||||
'trace_id': '7c284fd7-7f0d-4464-b5f8-3ef126df34af'})
|
'trace_id': '7c284fd7-7f0d-4464-b5f8-3ef126df34af'})
|
||||||
```
|
```
|
||||||
|
|
@ -35,7 +35,7 @@ As you can see, the original return value is wrapped in a [Trace][great_ai.Trace
|
||||||
|
|
||||||
Likely, the main way you would like to expose your model is through an HTTP API. [@GreatAI.create][great_ai.GreatAI.create] scaffolds many REST API endpoints for your model and creates a [FastAPI](https://fastapi.tiangolo.com/){ target=_blank } app available under [GreatAI.app][great_ai.GreatAI]. This can be served using [uvicorn](https://www.uvicorn.org/){ target=_blank } or any other [ASGI server](https://asgi.readthedocs.io/en/latest/){ target=_blank }.
|
Likely, the main way you would like to expose your model is through an HTTP API. [@GreatAI.create][great_ai.GreatAI.create] scaffolds many REST API endpoints for your model and creates a [FastAPI](https://fastapi.tiangolo.com/){ target=_blank } app available under [GreatAI.app][great_ai.GreatAI]. This can be served using [uvicorn](https://www.uvicorn.org/){ target=_blank } or any other [ASGI server](https://asgi.readthedocs.io/en/latest/){ target=_blank }.
|
||||||
|
|
||||||
Since most ML code lives in [Jupyter](https://jupyter.org/){ target=_blank } notebooks, therefore, deploying a notebook containing the inference function is supported. To achieve this, `uvicorn` is wrapped by the `great-ai` command-line utility which, among others, takes care of feeding a notebook into `uvicorn`. It also supports auto-reloading.
|
Since most ML code lives in [Jupyter](https://jupyter.org/){ target=_blank } notebooks, therefore, deploying a notebook containing the inference function is supported. To achieve this, `uvicorn` is wrapped by the `great-ai` command-line utility which — among others — takes care of feeding a notebook into `uvicorn`. It also supports auto-reloading.
|
||||||
|
|
||||||
### In development
|
### In development
|
||||||
|
|
||||||
|
|
@ -67,7 +67,7 @@ ENVIRONMENT=production great-ai greeter.py
|
||||||
```
|
```
|
||||||
|
|
||||||
Simply run `ENVIRONMENT=production great-ai deploy.ipynb` in the command-line of a production machine.
|
Simply run `ENVIRONMENT=production great-ai deploy.ipynb` in the command-line of a production machine.
|
||||||
> This is the crudest approach, however, it might be fitting for some contexts.
|
> This is the crudest approach; however, it might be fitting for some contexts.
|
||||||
|
|
||||||
#### Containerised deployment
|
#### Containerised deployment
|
||||||
|
|
||||||
|
|
@ -81,7 +81,7 @@ docker run -p 6060:6060 --volume `pwd`:/app --rm \
|
||||||
|
|
||||||
#### Use a Platform-as-a-Service
|
#### Use a Platform-as-a-Service
|
||||||
|
|
||||||
Similarly to the previous approach, your code will run in a container. However, instead of manually managing it, you can just choose from a plethora of PaaS providers (such as [AWS ECS](https://aws.amazon.com/ecs/){ target=_blank }, [DO App platform](https://www.digitalocean.com/products/app-platform){ target=_blank }, [MLEM](https://mlem.ai/){ target=_blank }, [Streamlit](https://streamlit.io/){ target=_blank }) that take a Docker image as a source and handle the rest of the deployment.
|
Similar to the previous approach, your code will run in a container. However, instead of manually managing it, you can just choose from a plethora of PaaS providers (such as [AWS ECS](https://aws.amazon.com/ecs/){ target=_blank }, [DO App platform](https://www.digitalocean.com/products/app-platform){ target=_blank }, [MLEM](https://mlem.ai/){ target=_blank }, [Streamlit](https://streamlit.io/){ target=_blank }) that take a Docker image as a source and handle the rest of the deployment.
|
||||||
|
|
||||||
To this end, you can also create a custom Docker image. It is especially useful if you have third-party dependencies, such as [PyTorch](https://pytorch.org/){ target=_blank } or [TensorFlow](https://www.tensorflow.org/){ target=_blank }.
|
To this end, you can also create a custom Docker image. It is especially useful if you have third-party dependencies, such as [PyTorch](https://pytorch.org/){ target=_blank } or [TensorFlow](https://www.tensorflow.org/){ target=_blank }.
|
||||||
|
|
||||||
|
|
@ -117,7 +117,7 @@ Processing larger amounts of data on a single machine is made easy by the [Great
|
||||||
'logged_values': {'arg:your_name:length': 5, 'arg:your_name:value': 'Alice'},
|
'logged_values': {'arg:your_name:length': 5, 'arg:your_name:value': 'Alice'},
|
||||||
'models': [],
|
'models': [],
|
||||||
'original_execution_time_ms': 0.1251,
|
'original_execution_time_ms': 0.1251,
|
||||||
'output': 'Hi Alice',
|
'output': 'Hi Alice!',
|
||||||
'tags': ['greeter', 'online', 'development'],
|
'tags': ['greeter', 'online', 'development'],
|
||||||
'trace_id': '90ffa15f-e839-41c4-8e7a-3211168bc138'}),
|
'trace_id': '90ffa15f-e839-41c4-8e7a-3211168bc138'}),
|
||||||
Trace[str]({'created': '2022-07-11T14:36:37.166659',
|
Trace[str]({'created': '2022-07-11T14:36:37.166659',
|
||||||
|
|
@ -126,7 +126,7 @@ Processing larger amounts of data on a single machine is made easy by the [Great
|
||||||
'logged_values': {'arg:your_name:length': 3, 'arg:your_name:value': 'Bob'},
|
'logged_values': {'arg:your_name:length': 3, 'arg:your_name:value': 'Bob'},
|
||||||
'models': [],
|
'models': [],
|
||||||
'original_execution_time_ms': 0.0571,
|
'original_execution_time_ms': 0.0571,
|
||||||
'output': 'Hi Bob',
|
'output': 'Hi Bob!',
|
||||||
'tags': ['greeter', 'online', 'development'],
|
'tags': ['greeter', 'online', 'development'],
|
||||||
'trace_id': 'f48e94c7-0815-48b3-a864-41349d3dae84'})]
|
'trace_id': 'f48e94c7-0815-48b3-a864-41349d3dae84'})]
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 160 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 154 KiB |
|
|
@ -31,8 +31,6 @@ Multiprocessing and multithreading-based parallelism with support for `async` fu
|
||||||
|
|
||||||
Because both [threaded_parallel_map][great_ai.utilities.parallel_map.threaded_parallel_map.threaded_parallel_map] and [parallel_map][great_ai.utilities.parallel_map.parallel_map.parallel_map] have a streaming interface, it is easy to compose them and end up with, for example, a process for each CPU core with its own thread-pool or event-loop. Longer pipelines are also easy to imagine. The chunking methods help in these compositions.
|
Because both [threaded_parallel_map][great_ai.utilities.parallel_map.threaded_parallel_map.threaded_parallel_map] and [parallel_map][great_ai.utilities.parallel_map.parallel_map.parallel_map] have a streaming interface, it is easy to compose them and end up with, for example, a process for each CPU core with its own thread-pool or event-loop. Longer pipelines are also easy to imagine. The chunking methods help in these compositions.
|
||||||
|
|
||||||
For more info, check-out [the scraping guide](/how-to-guides/scraping).
|
|
||||||
|
|
||||||
::: great_ai.utilities.chunk
|
::: great_ai.utilities.chunk
|
||||||
::: great_ai.utilities.unchunk
|
::: great_ai.utilities.unchunk
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue