Update README.md
Browse files
README.md
CHANGED
|
@@ -21,10 +21,11 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 21 |
from PIL import Image
|
| 22 |
|
| 23 |
model_id = "vikhyatk/moondream2"
|
|
|
|
| 24 |
model = AutoModelForCausalLM.from_pretrained(
|
| 25 |
-
model_id, trust_remote_code=True, revision=
|
| 26 |
)
|
| 27 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id, revision=
|
| 28 |
|
| 29 |
image = Image.open('<IMAGE_PATH>')
|
| 30 |
enc_image = model.encode_image(image)
|
|
|
|
| 21 |
from PIL import Image
|
| 22 |
|
| 23 |
model_id = "vikhyatk/moondream2"
|
| 24 |
+
revision = "2024-03-05"
|
| 25 |
model = AutoModelForCausalLM.from_pretrained(
|
| 26 |
+
model_id, trust_remote_code=True, revision=revision
|
| 27 |
)
|
| 28 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, revision=revision)
|
| 29 |
|
| 30 |
image = Image.open('<IMAGE_PATH>')
|
| 31 |
enc_image = model.encode_image(image)
|