HV-Khurdula commited on
Commit
a9ee753
·
verified ·
1 Parent(s): c7c8764

Update moondream.py

Browse files

fix: one method absorbed another method.

Files changed (1) hide show
  1. moondream.py +11 -11
moondream.py CHANGED
@@ -171,17 +171,17 @@ class MoondreamModel(nn.Module):
171
  blk.kv_cache.v_cache = torch.zeros(shape, device=device, dtype=dtype)
172
 
173
 
174
- def _setup_caches(self):
175
- c = self.config.text
176
- for b in self.text.blocks:
177
- b.kv_cache = KVCache(
178
- c.n_heads,
179
- c.n_kv_heads,
180
- c.max_context,
181
- c.dim,
182
- device=self.device,
183
- dtype=self.vision.pos_emb.dtype,
184
- )
185
 
186
  @property
187
  def device(self):
 
171
  blk.kv_cache.v_cache = torch.zeros(shape, device=device, dtype=dtype)
172
 
173
 
174
+ def _setup_caches(self):
175
+ c = self.config.text
176
+ for b in self.text.blocks:
177
+ b.kv_cache = KVCache(
178
+ c.n_heads,
179
+ c.n_kv_heads,
180
+ c.max_context,
181
+ c.dim,
182
+ device=self.device,
183
+ dtype=self.vision.pos_emb.dtype,
184
+ )
185
 
186
  @property
187
  def device(self):