executor ¶
Classes¶
fastvideo.worker.executor.Executor ¶
Executor(fastvideo_args: FastVideoArgs, *, log_queue=None)
Bases: ABC
Source code in fastvideo/worker/executor.py
Methods:¶
fastvideo.worker.executor.Executor.clear_log_queue abstractmethod ¶
fastvideo.worker.executor.Executor.collective_rpc abstractmethod ¶
collective_rpc(method: str | Callable[..., _R], timeout: float | None = None, args: tuple = (), kwargs: dict[str, Any] | None = None) -> list[_R]
Execute an RPC call on all workers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method | str | Callable[..., _R] | Name of the worker method to execute, or a callable that is serialized and sent to all workers to execute. If the method is a callable, it should accept an additional | required |
timeout | float | None | Maximum time in seconds to wait for execution. Raises a :exc: | None |
args | tuple | Positional arguments to pass to the worker method. | () |
kwargs | dict[str, Any] | None | Keyword arguments to pass to the worker method. | None |
Returns:
| Type | Description |
|---|---|
list[_R] | A list containing the results from each worker. |
Note
It is recommended to use this API to only pass control messages, and set up data-plane communication to pass data.
Source code in fastvideo/worker/executor.py
fastvideo.worker.executor.Executor.merge_lora_weights abstractmethod ¶
fastvideo.worker.executor.Executor.set_log_queue abstractmethod ¶
set_log_queue(log_queue: Queue | None) -> None
Forward worker logs to the given queue. Call before generate_video.
fastvideo.worker.executor.Executor.set_lora_adapter abstractmethod ¶
set_lora_adapter(lora_nickname: str, lora_path: str | None = None, strength: float = 1.0, accumulate: bool = False) -> None
Set the LoRA adapter for the workers.