code: def convert_s3prl_checkpoint(
      base_model_name, config_path, checkpoint_path, model_dump_path
  ):
      """
      Copy/paste/tweak model's weights to transformers design.
      """
      checkpoint = torch.load(checkpoint_path, map_location="cpu")
      if (
          checkpoint["Config"]["downstream_expert"]["modelrc"]["select"]
          not in SUPPORTED_MODELS
      ):
          raise NotImplementedError(
              f"The supported s3prl models are {SUPPORTED_MODELS}"
          )
  
      downstream_dict = checkpoint["Downstream"]
  
      hf_congfig = HubertConfig.from_pretrained(config_path)
      hf_model = HubertForSequenceClassification.from_pretrained(
          base_model_name, config=hf_congfig
      )
      hf_feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(
          base_model_name,
          return_attention_mask=True,
          do_normalize=False,
      )
  
      if hf_congfig.use_weighted_layer_sum:
          hf_model.layer_weights.data = checkpoint["Featurizer"][
              "weights"
          ]
  
      hf_model.projector.weight.data = downstream_dict[
          "projector.weight"
      ]
      hf_model.projector.bias.data = downstream_dict["projector.bias"]
      hf_model.classifier.weight.data = downstream_dict[
          "model.post_net.linear.weight"
      ]
      hf_model.classifier.bias.data = downstream_dict[
          "model.post_net.linear.bias"
      ]
  
      hf_feature_extractor.save_pretrained(model_dump_path)
      hf_model.save_pretrained(model_dump_path)
  
imports: import argparse
  import torch
  from transformers import HubertConfig, HubertForSequenceClassification, Wav2Vec2FeatureExtractor, logging
label_desc: Use image node_id 1 for calling a global function with example usage: convert_s3prl_checkpoint(base_model_name, config_path, checkpoint_path, model_dump_path) without return types