revert
Browse files
app.py
CHANGED
@@ -10,10 +10,11 @@ from torchvision.transforms.v2 import Resize
|
|
10 |
import subprocess
|
11 |
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
12 |
|
13 |
-
model_id = "
|
14 |
-
|
|
|
15 |
moondream = AutoModelForCausalLM.from_pretrained(
|
16 |
-
model_id, trust_remote_code=True,
|
17 |
torch_dtype=torch.bfloat16, device_map={"": "cuda"},
|
18 |
attn_implementation="flash_attention_2"
|
19 |
)
|
|
|
10 |
import subprocess
|
11 |
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
12 |
|
13 |
+
model_id = "vikhyatk/moondream2"
|
14 |
+
revision = "2024-05-20"
|
15 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, revision=revision)
|
16 |
moondream = AutoModelForCausalLM.from_pretrained(
|
17 |
+
model_id, trust_remote_code=True, revision=revision,
|
18 |
torch_dtype=torch.bfloat16, device_map={"": "cuda"},
|
19 |
attn_implementation="flash_attention_2"
|
20 |
)
|