Buckets:

mishig's picture
|
download
raw
3.21 kB
# Trạng thái Pipeline
## PipelineState[[diffusers.modular_pipelines.PipelineState]]
#### diffusers.modular_pipelines.PipelineState[[diffusers.modular_pipelines.PipelineState]]
```python
diffusers.modular_pipelines.PipelineState(values: dict[str, typing.Any] = <factory>, kwargs_mapping: dict[str, list[str]] = <factory>)
```
[Nguồn](https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/modular_pipeline.py#L231)
`PipelineState` lưu trữ trạng thái của một pipeline. Nó được dùng để truyền dữ liệu giữa các khối pipeline.
#### get[[diffusers.modular_pipelines.PipelineState.get]]
```python
get(keys: str | list[str], default: Any = None)
```
[Nguồn](https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/modular_pipeline.py#L256)
**Tham số:**
keys (str | list[str]) : Khóa hoặc danh sách các khóa cho các giá trị
default (Any) : Giá trị mặc định để trả về nếu không tìm thấy
**Trả về:** Any | dict[str, Any]
Giá trị đơn nếu keys là str, từ điển các giá trị nếu keys là list
Lấy một hoặc nhiều giá trị từ trạng thái pipeline.
#### get_by_kwargs[[diffusers.modular_pipelines.PipelineState.get_by_kwargs]]
```python
get_by_kwargs(kwargs_type: str)
```
[Nguồn](https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/modular_pipeline.py#L271)
**Tham số:**
kwargs_type (str) : kwargs_type để lọc
**Trả về:** dict[str, Any]
Từ điển các giá trị có kwargs_type khớp
Lấy tất cả các giá trị có kwargs_type khớp.
#### set[[diffusers.modular_pipelines.PipelineState.set]]
```python
set(key: str, value: Any, kwargs_type: str = None)
```
[Nguồn](https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/modular_pipeline.py#L239)
**Tham số:**
key (str) : Khóa cho giá trị
value (Bất kỳ) : Giá trị cần lưu trữ
kwargs_type (str) : kwargs_type mà giá trị được liên kết
Thêm một giá trị vào trạng thái pipeline.
#### to_dict[[diffusers.modular_pipelines.PipelineState.to_dict]]
```python
to_dict()
```
[Nguồn](https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/modular_pipeline.py#L284)
Chuyển đổi PipelineState thành một từ điển.
## BlockState[[diffusers.modular_pipelines.BlockState]]
#### diffusers.modular_pipelines.BlockState[[diffusers.modular_pipelines.BlockState]]
```python
diffusers.modular_pipelines.BlockState(**kwargs)
```
[Nguồn](https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/modular_pipeline.py#L321)
Container cho dữ liệu trạng thái khối với khả năng truy cập thuộc tính và biểu diễn định dạng.
#### as_dict[[diffusers.modular_pipelines.BlockState.as_dict]]
```python
as_dict()
```
[Nguồn](https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/modular_pipeline.py#L338)
**Trả về:** dict[str, Any]
Từ điển chứa tất cả các thuộc tính của BlockState
Chuyển đổi BlockState thành một từ điển.

Xet Storage Details

Size:
3.21 kB
·
Xet hash:
316893bbdc3abd6ecc349971697d93e90ccc0eff3e7c5c7602dcd494aae57a51

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.