hezar.models.image2text.vit_gpt2.vit_gpt2_image2text_config module¶
- class hezar.models.image2text.vit_gpt2.vit_gpt2_image2text_config.DecoderConfig(add_cross_attention: bool = True, vocab_size: int = 42001, attn_pdrop: float = 0.1, bos_token_id: int = 5, embd_pdrop: float = 0.1, eos_token_id: int = 5, gradient_checkpointing: bool = False, initializer_range: float = 0.02, layer_norm_epsilon: float = 1e-05, model_type: str = 'gpt2', n_ctx: int = 1024, n_embd: int = 768, n_head: int = 12, n_inner: int = None, n_layer: int = 12, n_positions: int = 1024, resid_pdrop: float = 0.1, summary_activation: bool = False, summary_first_dropout: float = 0.1, use_cache: bool = True)[source]¶
Bases:
ModelConfig
- add_cross_attention: bool = True¶
- attn_pdrop: float = 0.1¶
- bos_token_id: int = 5¶
- embd_pdrop: float = 0.1¶
- eos_token_id: int = 5¶
- gradient_checkpointing: bool = False¶
- initializer_range: float = 0.02¶
- layer_norm_epsilon: float = 1e-05¶
- model_type: str = 'gpt2'¶
- n_ctx: int = 1024¶
- n_embd: int = 768¶
- n_head: int = 12¶
- n_inner: int = None¶
- n_layer: int = 12¶
- n_positions: int = 1024¶
- name: str = 'vit_gpt2_decoder'¶
- resid_pdrop: float = 0.1¶
- summary_activation: bool = False¶
- summary_first_dropout: float = 0.1¶
- use_cache: bool = True¶
- vocab_size: int = 42001¶
- class hezar.models.image2text.vit_gpt2.vit_gpt2_image2text_config.EncoderConfig(hidden_size: int = 768, num_hidden_layers: int = 12, num_attention_heads: int = 12, intermediate_size: int = 3072, hidden_act: str = 'gelu', hidden_dropout_prob: float = 0.0, attention_probs_dropout_prob: float = 0.0, initializer_range: float = 0.02, layer_norm_eps: float = 1e-12, image_size: int = 224, patch_size: int = 16, num_channels: int = 3, qkv_bias: bool = True, encoder_stride: int = 16)[source]¶
Bases:
ModelConfig
- attention_probs_dropout_prob: float = 0.0¶
- encoder_stride: int = 16¶
- image_size: int = 224¶
- initializer_range: float = 0.02¶
- intermediate_size: int = 3072¶
- layer_norm_eps: float = 1e-12¶
- name: str = 'vit_gpt2_encoder'¶
- num_attention_heads: int = 12¶
- num_channels: int = 3¶
- patch_size: int = 16¶
- qkv_bias: bool = True¶
- class hezar.models.image2text.vit_gpt2.vit_gpt2_image2text_config.GenerationConfig(bos_token_id: int = 0, decoder_start_token_id: int = 0, early_stopping: bool = True, eos_token_id: int = 2, length_penalty: float = 2.0, max_new_tokens: int = 24, no_repeat_ngram_size: int = 3, num_beams: int = 4, pad_token_id: int = 1)[source]¶
Bases:
ModelConfig
- bos_token_id: int = 0¶
- decoder_start_token_id: int = 0¶
- early_stopping: bool = True¶
- eos_token_id: int = 2¶
- length_penalty: float = 2.0¶
- max_new_tokens: int = 24¶
- no_repeat_ngram_size: int = 3¶
- num_beams: int = 4¶
- pad_token_id: int = 1¶
- class hezar.models.image2text.vit_gpt2.vit_gpt2_image2text_config.ViTGPT2Image2TextConfig(encoder: hezar.models.image2text.vit_gpt2.vit_gpt2_image2text_config.EncoderConfig = <factory>, decoder: hezar.models.image2text.vit_gpt2.vit_gpt2_image2text_config.DecoderConfig = <factory>, generation: hezar.models.image2text.vit_gpt2.vit_gpt2_image2text_config.GenerationConfig = <factory>)[source]¶
Bases:
ModelConfig
- decoder: DecoderConfig¶
- encoder: EncoderConfig¶
- generation: GenerationConfig¶
- name: str = 'vit_gpt2_image2text'¶