Merge pull request #116 from daily-co/moondream-use-cpu

moondream: allow passing use_cpu
This commit is contained in:
Aleix Conchillo Flaqué
2024-04-11 09:08:11 +08:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -61,6 +61,7 @@ async def main(room_url: str, token):
vision_aggregator = VisionImageFrameAggregator() vision_aggregator = VisionImageFrameAggregator()
# If you run into weird description, try with use_cpu=True
moondream = MoondreamService() moondream = MoondreamService()
tts = ElevenLabsTTSService( tts = ElevenLabsTTSService(

View File

@@ -25,11 +25,11 @@ class MoondreamService(VisionService):
self, self,
model_id="vikhyatk/moondream2", model_id="vikhyatk/moondream2",
revision="2024-04-02", revision="2024-04-02",
device=None use_cpu=False
): ):
super().__init__() super().__init__()
if not device: if not use_cpu:
device, dtype = detect_device() device, dtype = detect_device()
else: else:
device = torch.device("cpu") device = torch.device("cpu")