Skip to content

Commit

Permalink
Updated to revision 23-03-13
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis committed Mar 14, 2024
1 parent 0348850 commit 517fdb8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
from transformers import TextIteratorStreamer, AutoTokenizer, AutoModelForCausalLM

MODEL_NAME = "vikhyatk/moondream2"
REVISION = "2024-03-13"
MODEL_CACHE = "checkpoints"
MODEL_URL = "https://weights.replicate.delivery/default/vikhyatk/moondream2-24-03-06.tar"
MODEL_URL = "https://weights.replicate.delivery/default/vikhyatk/moondream2-24-03-13.tar"

def download_weights(url, dest):
start = time.time()
Expand All @@ -31,13 +32,13 @@ def setup(self) -> None:
download_weights(MODEL_URL, MODEL_CACHE)
self.tokenizer = AutoTokenizer.from_pretrained(
MODEL_NAME,
revision="2024-03-06",
revision=REVISION,
cache_dir=MODEL_CACHE
)
self.moondream = AutoModelForCausalLM.from_pretrained(
MODEL_NAME,
trust_remote_code=True,
revision="2024-03-06",
revision=REVISION,
torch_dtype=torch.float16,
attn_implementation="flash_attention_2",
cache_dir=MODEL_CACHE
Expand Down

0 comments on commit 517fdb8

Please sign in to comment.