vikhyatk commited on
Commit
90f21ed
1 Parent(s): 6eb5bbc

Upload Moondream

Browse files
Files changed (2) hide show
  1. moondream.py +1 -1
  2. text_model.py +1 -2
moondream.py CHANGED
@@ -12,7 +12,7 @@ class Moondream(PreTrainedModel):
12
  def __init__(self, config):
13
  super().__init__(config)
14
  self.vision_encoder = VisionEncoder()
15
- self.text_model = TextModel(config, None)
16
 
17
  @property
18
  def device(self):
 
12
  def __init__(self, config):
13
  super().__init__(config)
14
  self.vision_encoder = VisionEncoder()
15
+ self.text_model = TextModel(config)
16
 
17
  @property
18
  def device(self):
text_model.py CHANGED
@@ -7,7 +7,7 @@ transformers.logging.set_verbosity_error()
7
 
8
 
9
  class TextModel(nn.Module):
10
- def __init__(self, config, tokenizer) -> None:
11
  super().__init__()
12
 
13
  if type(config.phi_config) == dict:
@@ -17,4 +17,3 @@ class TextModel(nn.Module):
17
 
18
  self.model = PhiForCausalLM(phi_config)
19
  self.text_emb = self.model.get_input_embeddings()
20
- self.tokenizer = tokenizer
 
7
 
8
 
9
  class TextModel(nn.Module):
10
+ def __init__(self, config) -> None:
11
  super().__init__()
12
 
13
  if type(config.phi_config) == dict:
 
17
 
18
  self.model = PhiForCausalLM(phi_config)
19
  self.text_emb = self.model.get_input_embeddings()