nielsr HF staff commited on
Commit
9fb97ac
1 Parent(s): 6e8bac3

Comment out code

Browse files
Files changed (1) hide show
  1. visual.py +18 -18
visual.py CHANGED
@@ -102,33 +102,33 @@ class Transformer(nn.Module):
102
  def forward(self, hidden_states):
103
 
104
  print("Shape of hidden states before CLIP:", hidden_states.shape)
105
- torch.save(hidden_states, "hidden_states_before_clip.pt")
106
 
107
- from huggingface_hub import HfApi
108
 
109
- api = HfApi()
110
- api.upload_file(
111
- path_or_fileobj="hidden_states_before_clip.pt",
112
- path_in_repo="hidden_states_before_clip.pt",
113
- repo_id="nielsr/test-cogvlm",
114
- repo_type="dataset",
115
- )
116
 
117
  for idx, layer_module in enumerate(self.layers):
118
  hidden_states = layer_module(hidden_states, print_values=idx==0)
119
 
120
  print("Shape of hidden states after CLIP:", hidden_states.shape)
121
- torch.save(hidden_states, "hidden_states_after_clip.pt")
122
 
123
- from huggingface_hub import HfApi
124
 
125
- api = HfApi()
126
- api.upload_file(
127
- path_or_fileobj="hidden_states_after_clip.pt",
128
- path_in_repo="hidden_states_after_clip.pt",
129
- repo_id="nielsr/test-cogvlm",
130
- repo_type="dataset",
131
- )
132
 
133
  return hidden_states
134
 
 
102
  def forward(self, hidden_states):
103
 
104
  print("Shape of hidden states before CLIP:", hidden_states.shape)
105
+ # torch.save(hidden_states, "hidden_states_before_clip.pt")
106
 
107
+ # from huggingface_hub import HfApi
108
 
109
+ # api = HfApi()
110
+ # api.upload_file(
111
+ # path_or_fileobj="hidden_states_before_clip.pt",
112
+ # path_in_repo="hidden_states_before_clip.pt",
113
+ # repo_id="nielsr/test-cogvlm",
114
+ # repo_type="dataset",
115
+ # )
116
 
117
  for idx, layer_module in enumerate(self.layers):
118
  hidden_states = layer_module(hidden_states, print_values=idx==0)
119
 
120
  print("Shape of hidden states after CLIP:", hidden_states.shape)
121
+ # torch.save(hidden_states, "hidden_states_after_clip.pt")
122
 
123
+ # from huggingface_hub import HfApi
124
 
125
+ # api = HfApi()
126
+ # api.upload_file(
127
+ # path_or_fileobj="hidden_states_after_clip.pt",
128
+ # path_in_repo="hidden_states_after_clip.pt",
129
+ # repo_id="nielsr/test-cogvlm",
130
+ # repo_type="dataset",
131
+ # )
132
 
133
  return hidden_states
134