dslee2601 commited on
Commit
7870846
1 Parent(s): ca3d9cd
save_audioMAE_self_sustainable.ipynb CHANGED
@@ -35,9 +35,6 @@
35
  "outputs": [],
36
  "source": [
37
  "# Registering a model with custom code to the auto classes\n",
38
- "\n",
39
- "# AutoConfig.register(\"audiomae\", AudioMAEConfig) # doesn't seem needed; redundant with the one below.\n",
40
- "# AutoModel.register(AudioMAEConfig, PretrainedAudioMAEEncoder) # doesn't seem needed; redundant with the one below.\n",
41
  "AudioMAEConfig.register_for_auto_class()\n",
42
  "PretrainedAudioMAEEncoder.register_for_auto_class()"
43
  ]
@@ -53,33 +50,6 @@
53
  "model = PretrainedAudioMAEEncoder(config)"
54
  ]
55
  },
56
- {
57
- "cell_type": "code",
58
- "execution_count": 4,
59
- "metadata": {},
60
- "outputs": [
61
- {
62
- "name": "stderr",
63
- "output_type": "stream",
64
- "text": [
65
- "c:\\Users\\dslee\\anaconda3\\envs\\sound_effect_variation_generation\\lib\\site-packages\\timm\\models\\_hub.py:190: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.\n",
66
- " return torch.load(cached_file, map_location='cpu')\n"
67
- ]
68
- }
69
- ],
70
- "source": [
71
- "# # load pretrained model and get the pretrained weights\n",
72
- "# pretrained_model = timm.create_model(\"hf_hub:gaunernst/vit_base_patch16_1024_128.audiomae_as2m\", pretrained=True)\n",
73
- "# pretrained_model = pretrained_model.eval()\n",
74
- "# pretrained_state_dict = pretrained_model.state_dict()\n",
75
- "\n",
76
- "# # update the key names\n",
77
- "# new_keys = []\n",
78
- "# for k in pretrained_state_dict.keys():\n",
79
- "# new_keys.append('encoder.' + k)\n",
80
- "# pretrained_state_dict = {new_keys[i]: v for i, (k, v) in enumerate(pretrained_state_dict.items())}"
81
- ]
82
- },
83
  {
84
  "cell_type": "code",
85
  "execution_count": 4,
 
35
  "outputs": [],
36
  "source": [
37
  "# Registering a model with custom code to the auto classes\n",
 
 
 
38
  "AudioMAEConfig.register_for_auto_class()\n",
39
  "PretrainedAudioMAEEncoder.register_for_auto_class()"
40
  ]
 
50
  "model = PretrainedAudioMAEEncoder(config)"
51
  ]
52
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  {
54
  "cell_type": "code",
55
  "execution_count": 4,