code: def __init__(self, config):
      super().__init__(config)
  
      self.embeddings = nn.Embedding(
          config.vocab_size, config.hidden_size
      )
      self.blocks = nn.ModuleList(
          [
              RwkvBlock(config, layer_id=idx)
              for idx in range(config.num_hidden_layers)
          ]
      )
      self.ln_out = nn.LayerNorm(config.hidden_size)
  
      self.layers_are_rescaled = False
  
      self.gradient_checkpointing = False
  
      # Initialize weights and apply final processing
      self.post_init()
  
imports: import math
  from dataclasses import dataclass
  from pathlib import Path
  from typing import List, Optional, Tuple, Union
  import torch
  import torch.utils.checkpoint
  from torch import nn
  from torch.nn import CrossEntropyLoss
  from ...modeling_utils import PreTrainedModel
  from ...utils import ModelOutput, add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward, is_bitsandbytes_available, is_ninja_available, is_torch_cuda_available, logging
  from .configuration_rwkv import RwkvConfig
label_desc: Use image node_id 1 to create a new RwkvModel object from inherited base classes: RwkvPreTrainedModel with example: obj = RwkvModel(config)