----------------------
Based on the information provided in the extracts, you can set the number of workers for parallel execution in the
pipeline.run()
method. Here's an example:
nodes = pipeline.run(documents=documents, num_workers=4)
In this example,
num_workers
is set to
4
, which means the pipeline will use 4 workers for parallel execution.
However, the specific details on how to set
num_workers
to the maximum number of workers available are not provided in the extracts. In Python, you can usually get the number of available processors with
os.cpu_count()
, but it's not clear from the extracts whether you can pass this value directly to
num_workers
.
Here's an example of how you might do it based on general Python knowledge:
import os
num_workers = os.cpu_count()
nodes = pipeline.run(documents=documents, num_workers=num_workers)
Please note that this is a high-level approach and the specific implementation details might vary based on your exact requirements.
For more detailed instructions, you might want to refer to the
LlamaIndex documentation () and the
example notebooks on GitHub ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------