vikhyatk commited on
Commit
66847d8
1 Parent(s): 2a4b8c9

Upload Moondream

Browse files
Files changed (3) hide show
  1. configuration_moondream.py +0 -3
  2. model.safetensors +1 -1
  3. moondream.py +2 -2
configuration_moondream.py CHANGED
@@ -1,8 +1,5 @@
1
  from transformers import PretrainedConfig
2
 
3
- from typing import Optional
4
- import math
5
-
6
 
7
  class PhiConfig(PretrainedConfig):
8
  model_type = "phi"
 
1
  from transformers import PretrainedConfig
2
 
 
 
 
3
 
4
  class PhiConfig(PretrainedConfig):
5
  model_type = "phi"
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:493ac8972766b8e4b9005bfab11454b93aab4987b44a01debebec3fa96773105
3
  size 3715037856
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15daa0c9a135d2084520e47d517ef689e09ee71c63d606bd8b8ff209bacc3e34
3
  size 3715037856
moondream.py CHANGED
@@ -91,7 +91,7 @@ class Moondream(PreTrainedModel):
91
  result_queue=None,
92
  **kwargs,
93
  ):
94
- prompt = f"<image>\n\n{chat_history}Question: {question}\n\nAnswer: "
95
  answer = self.generate(
96
  image_embeds,
97
  prompt,
@@ -120,7 +120,7 @@ class Moondream(PreTrainedModel):
120
  image_embeds = self.encode_image(images)
121
 
122
  templated_prompts = [
123
- f"<image>\n\nQuestion: {prompt}\n\nAnswer: " for prompt in prompts
124
  ]
125
  prompt_embs = [
126
  self.input_embeds(prompt, image_embed.unsqueeze(0), tokenizer)[0]
 
91
  result_queue=None,
92
  **kwargs,
93
  ):
94
+ prompt = f"<image>\n\n{chat_history}Question: {question}\n\nAnswer:"
95
  answer = self.generate(
96
  image_embeds,
97
  prompt,
 
120
  image_embeds = self.encode_image(images)
121
 
122
  templated_prompts = [
123
+ f"<image>\n\nQuestion: {prompt}\n\nAnswer:" for prompt in prompts
124
  ]
125
  prompt_embs = [
126
  self.input_embeds(prompt, image_embed.unsqueeze(0), tokenizer)[0]