Yuliang-Liu / Monkey

【CVPR 2024 Highlight】Monkey (LMM): Image Resolution and Text Label Are Important Things for Large Multi-modal Models
MIT License
1.82k stars 128 forks source link

How to set gpu card for the demo project running #93

Closed Mararesliu closed 5 months ago

Mararesliu commented 5 months ago

I use os.environ["CUDA_VISIBLE_DEVICES"] = "4" or env to run demo.py, always default use 0, How can i use other gpu card, Is there any i can manully set it?

echo840 commented 5 months ago

CUDA_VISIBLE_DEVICES=4 python demo_textmonkey.py -c model_path

Maybe you can add "CUDA_VISIBLE_DEVICES=4".

echo840 commented 5 months ago

image device_map="cuda:4" image input_ids=input_ids.to("cuda:4"), attention_mask=attention_mask.to("cuda:4"),

Alternatively, you can modify the code here.

Mararesliu commented 5 months ago

The first way not change too. The second way demo can no start ,rasie error 图片 图片

echo840 commented 5 months ago

Is your GPU functioning properly? Can you run other models on "cuda:4"? I don't think this is an issue with our code.

Mararesliu commented 5 months ago

It works, many thinks.