Skip to content

Commit

Permalink
moondream: allow passing use_cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
aconchillo committed Apr 11, 2024
1 parent 1a0a66e commit 130e418
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/foundational/12-describe-video.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ async def main(room_url: str, token):

vision_aggregator = VisionImageFrameAggregator()

# If you run into weird description, try with use_cpu=True
moondream = MoondreamService()

tts = ElevenLabsTTSService(
Expand Down
4 changes: 2 additions & 2 deletions src/dailyai/services/moondream_ai_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ def __init__(
self,
model_id="vikhyatk/moondream2",
revision="2024-04-02",
device=None
use_cpu=False
):
super().__init__()

if not device:
if not use_cpu:
device, dtype = detect_device()
else:
device = torch.device("cpu")
Expand Down

0 comments on commit 130e418

Please sign in to comment.