HPT icon indicating copy to clipboard operation
HPT copied to clipboard

After I completed the deployment and executed the demo:

Open nUser0 opened this issue 1 year ago • 3 comments

(HPT) D:\HPT>python demo/demo.py --image_path demo/einstein.jpg --text 'Question: What is unusual about this image?\nAnswer:' --model hpt-air-demo usage: demo.py [-h] --image_path IMAGE_PATH [IMAGE_PATH ...] --text TEXT --model MODEL [--nproc NPROC] [--verbose] demo.py: error: unrecognized arguments: What is unusual about this image?\nAnswer:'

nUser0 avatar Mar 21 '24 15:03 nUser0

I changed the single quotes to double quotes and the above problem was solved. But for some reason it always downloads the model from the Internet, even though I have set the path to the local model.

nUser0 avatar Mar 22 '24 10:03 nUser0

I know, I need to modify the model parameters: python demo/demo.py --image_path demo/einstein.jpg --text "Question: What is unusual about this image?\nAnswer:" --model hpt-air-demo- local

nUser0 avatar Mar 22 '24 11:03 nUser0

change the bert config in modeling_hformer.py bert = 'xxx/bert-base-uncased' print('local bert:', bert) encoder_config = BertConfig.from_pretrained(bert)

zhouxingguang avatar Mar 25 '24 06:03 zhouxingguang