unitorch.cli.models.kolors¤
KolorsMPSProcessor¤
Tip
core/process/kolors/mps is the section for configuration of KolorsMPSProcessor.
Bases: KolorsMPSProcessor
Processor for the Kolors MPS model.
Source code in src/unitorch/cli/models/kolors/processing.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
from_config
classmethod
¤
from_config(config, **kwargs)
Source code in src/unitorch/cli/models/kolors/processing.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
_classification ¤
_classification(
text: str,
image: Union[Image, str],
condition: str,
max_seq_length: Optional[int] = None,
)
Source code in src/unitorch/cli/models/kolors/processing.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
KolorsMPSModel¤
Tip
core/model/classification/kolors/mps is the section for configuration of KolorsMPSModel.
Bases: KolorsMPSModel
Kolors MPS model for image-text classification.
Source code in src/unitorch/cli/models/kolors/modeling.py
24 25 26 27 | |
from_config
classmethod
¤
from_config(config, **kwargs)
Source code in src/unitorch/cli/models/kolors/modeling.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
forward ¤
forward(
input_ids: Tensor,
pixel_values: Tensor,
condition_input_ids: Tensor,
attention_mask: Optional[Tensor] = None,
position_ids: Optional[Tensor] = None,
condition_attention_mask: Optional[Tensor] = None,
condition_position_ids: Optional[Tensor] = None,
labels: Optional[Tensor] = None,
)
Source code in src/unitorch/cli/models/kolors/modeling.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |