John Ho commited on
Commit
56b5c79
Β·
1 Parent(s): f41583e

testing moondream3

Browse files
Files changed (2) hide show
  1. app.py +13 -13
  2. requirements.txt +2 -2
app.py CHANGED
@@ -8,22 +8,22 @@ from typing import Literal
8
  # @spaces.GPU(duration=30)
9
  def load_model():
10
  # moondream2
11
- return AutoModelForCausalLM.from_pretrained(
12
- "vikhyatk/moondream2",
13
- revision="2025-04-14",
14
- trust_remote_code=True,
15
- device_map={"": "cuda"},
16
- )
17
-
18
- # moondream3-preview
19
- # moondream = AutoModelForCausalLM.from_pretrained(
20
- # "moondream/moondream3-preview",
21
  # trust_remote_code=True,
22
- # dtype=torch.bfloat16,
23
  # device_map={"": "cuda"},
24
  # )
25
- # moondream.compile()
26
- # return moondream
 
 
 
 
 
 
 
 
27
 
28
 
29
  _MODEL = (
 
8
  # @spaces.GPU(duration=30)
9
  def load_model():
10
  # moondream2
11
+ # return AutoModelForCausalLM.from_pretrained(
12
+ # "vikhyatk/moondream2",
13
+ # revision="2025-04-14",
 
 
 
 
 
 
 
14
  # trust_remote_code=True,
 
15
  # device_map={"": "cuda"},
16
  # )
17
+
18
+ # moondream3-preview
19
+ moondream = AutoModelForCausalLM.from_pretrained(
20
+ "moondream/moondream3-preview",
21
+ trust_remote_code=True,
22
+ dtype=torch.bfloat16,
23
+ device_map={"": "cuda"},
24
+ )
25
+ moondream.compile()
26
+ return moondream
27
 
28
 
29
  _MODEL = (
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
- transformers==4.44.0
2
  pydantic
3
  pyvips-binary==8.16.0
4
  pyvips==2.2.3
5
- accelerate==0.32.1
 
1
+ transformers>=4.56.0
2
  pydantic
3
  pyvips-binary==8.16.0
4
  pyvips==2.2.3
5
+ accelerate>=1.0.0