OFASys
OFASys copied to clipboard
Unable to load the checkpoint
Hi,
When I run the following code as shown in Readme:
model = OFASys.from_pretrained('multitask_10k.pt')
I had the following error:
First, update the ofasys package to the latest version:
pip install -U http://ofasys.oss-cn-zhangjiakou.aliyuncs.com/pkg/ofasys-0.1.0-py3-none-any.whl
Then, try to use a remote link to initialize the model, as in the documents:
from ofasys import OFASys
model = OFASys.from_pretrained('http://ofasys.oss-cn-zhangjiakou.aliyuncs.com/model_hub/multitask_10k.pt')
model = model.cuda() # Omit this line if you don't have a GPU
Or you can download the checkpoint first, and then load it locally:
wget http://ofasys.oss-cn-zhangjiakou.aliyuncs.com/model_hub/multitask_10k.pt
python
>> model = OFASys.from_pretrained('multitask_10k.pt')
It works fine on my computer. Hope this would help you.
If you still have this problem, do not hesitate to contact us! And please provide the complete python script and system information.