-
Notifications
You must be signed in to change notification settings - Fork 545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add device argument to eval_model function #27
base: main
Are you sure you want to change the base?
Conversation
This commit introduces a new argument `--device` to the `eval_model` function, allowing users to specify the device to be used (e.g., 'cpu' or 'cuda'). The code has been updated to handle the device argument appropriately, ensuring compatibility with both CPU and GPU.
Can you create a repo? I will cite your job on the community contribution. |
Hello, sorry, I wouldn't be understanding what you mean by Can you create a repository? I already made a fork. |
Sorry, I miss your fork repo. Thank u very much for your contribution. |
I got some problem while I install flash-attn because of lacking CUDA support. Did you install this package successfully? Or is it mandatory for CPU version? |
Hello @iLoveBug I did not install flash-attn. |
@Ucas-HaoranWei will you consider merging this feature? It would be great to be able to keep up with the main repo without having to manually patch this in |
!python3 /content/GOT-OCR2.0/GOT-OCR-2.0-master/GOT/demo/run_ocr_2.0.py --model-name ./content/GOT_weights --image-file /content/ANACO-MOTOS-26-3-10AM.jpg --type ocr --device cpu 2024-09-25 02:02:21.949838: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:485] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered |
CONVOCATORIA |
y |
thank you ElvisClaros |
In GOT-OCR-2.0-master/GOT/demo/run_ocr_2.0_crop.py - Introduced `device` argument to specify the device for model evaluation. - Updated model loading and tensor operations to use the specified device. - Adjusted image processing and tensor casting based on the device. - Added `--device` argument to the command-line parser with default 'cuda'.
!git clone https://github.com/Ucas-HaoranWei/GOT-OCR2.0.git %cd /content/GOT-OCR2.0/GOT-OCR-2.0-master !git clone https://huggingface.co/stepfun-ai/GOT-OCR2_0 شغال!python3 /content/GOT-OCR2.0/GOT-OCR-2.0-master/GOT/demo/run_ocr_2.0.py --model-name /content/GOT-OCR2.0/GOT-OCR-2.0-master/GOT/model/GOT-OCR2_0 --image-file /content/ANACO-MOTOS-26-3-10AM.jpg --type ocr --device cpu !python3 /content/GOT-OCR2.0/GOT-OCR-2.0-master/GOT/demo/run_ocr_2.0.py --model-name /content/GOT-OCR2.0/GOT-OCR-2.0-master/GOT/model/GOT-OCR2_0 --image-file /content/comprobar-sorteo-bonoloto-hoy-resultado-miercoles-8_98.webp --type ocr --device cpu |
Any update? |
Can the ability to support the CPU run on macOS x86_64? I got some problem while I run:
|
@Ucas-HaoranWei hi, is there any problem that can't be merge? this feature is very useful, really hope it can be merged. |
This commit introduces a new argument
--device
to theeval_model
function, allowing users to specify the device to be used (e.g., 'cpu' or 'cuda'). The code has been updated to handle the device argument appropriately, ensuring compatibility with both CPU and GPU.