Update README.md
Browse files
README.md
CHANGED
|
@@ -9,8 +9,25 @@ language:
|
|
| 9 |
The model is release for research purposes only, commercial use is not allowed.
|
| 10 |
|
| 11 |
Try it out on [Huggingface Spaces](https://huggingface.co/spaces/vikhyatk/moondream1)!
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
## Benchmarks
|
| 16 |
|
|
|
|
| 9 |
The model is release for research purposes only, commercial use is not allowed.
|
| 10 |
|
| 11 |
Try it out on [Huggingface Spaces](https://huggingface.co/spaces/vikhyatk/moondream1)!
|
| 12 |
+
|
| 13 |
+
**Usage**
|
| 14 |
+
|
| 15 |
+
```
|
| 16 |
+
pip install transformers timm einops
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
```python
|
| 20 |
+
from transformers import AutoModelForCausalLM, CodeGenTokenizerFast as Tokenizer
|
| 21 |
+
from PIL import Image
|
| 22 |
+
|
| 23 |
+
model_id = "vikhyatk/moondream1"
|
| 24 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True)
|
| 25 |
+
tokenizer = Tokenizer.from_pretrained(model_id)
|
| 26 |
+
|
| 27 |
+
image = Image.open('<IMAGE_PATH>')
|
| 28 |
+
enc_image = model.encode_image(image)
|
| 29 |
+
print(model.answer_question(enc_image, "<QUESTION>", tokenizer))
|
| 30 |
+
```
|
| 31 |
|
| 32 |
## Benchmarks
|
| 33 |
|