OpenBMB / Eurus

Apache License 2.0
262 stars 15 forks source link

AttributeError: 'BaseModelOutputWithPast' object has no attribute 'item' #11

Open AIR-hl opened 2 months ago

AIR-hl commented 2 months ago

When I using local model files and setting trust_remote_code=False will appear following error: image

lifan-yuan commented 2 months ago

Hi,

trust_remote_code=True is necessary because the transformers library does not originally support the model structure. An alternative approach is to paste the model code in your Python file and directly load the checkpoint by EurusRewardModel.from_pretrained()