-
Notifications
You must be signed in to change notification settings - Fork 102
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
OSError: Can't load weights for 'xlm-roberta-base'. #83
Comments
Did you solve this problem? I have the same question. |
I have not solved the problem yet, i use another nlptools for my study. If you fix it,could you tell me?thank you!
…________________________________
From: Jiahaohong ***@***.***>
Sent: Thursday, March 28, 2024 11:06 AM
To: nlp-uoregon/trankit ***@***.***>
Cc: Xu Yue ***@***.***>; Author ***@***.***>
Subject: Re: [nlp-uoregon/trankit] OSError: Can't load weights for 'xlm-roberta-base'. (Issue #83)
Did you solve this problem? I have the same question.
—
Reply to this email directly, view it on GitHub<#83 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARRIME2XZZDCCRTBCLHYHWDY2OCMZAVCNFSM6AAAAABFDMZDW6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRUGMYTKNBXG4>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I solve the problm by repalcing the model path to my local model path.
|
thank you!谢谢你!
…________________________________
From: Jiahaohong ***@***.***>
Sent: Thursday, March 28, 2024 3:08 PM
To: nlp-uoregon/trankit ***@***.***>
Cc: Xu Yue ***@***.***>; Author ***@***.***>
Subject: Re: [nlp-uoregon/trankit] OSError: Can't load weights for 'xlm-roberta-base'. (Issue #83)
I solve the problm by repalcing the model path to my local model path.
# ./trankit-master/trankit/models/base_models.py
class Base_Model(nn.Module): # currently assuming the pretrained transformer is XLM-Roberta
def __init__(self, config, task_name):
super().__init__()
self.config = config
self.task_name = task_name
# xlmr encoder
self.xlmr_dim = 768 if config.embedding_name == 'xlm-roberta-base' else 1024
# self.xlmr = XLMRobertaModel.from_pretrained(config.embedding_name,
# cache_dir=os.path.join(config._cache_dir, config.embedding_name),
# output_hidden_states=True)
self.xlmr = XLMRobertaModel.from_pretrained('./cache/xlm-roberta-base',
cache_dir=os.path.join(config._cache_dir, config.embedding_name),
output_hidden_states=True)
―
Reply to this email directly, view it on GitHub<#83 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARRIMEYPF4EOMGF5MOGB2ITY2O6WZAVCNFSM6AAAAABFDMZDW6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRUGU2DKNRYHE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OSError: Can't load weights for 'xlm-roberta-base'. Make sure that:
'xlm-roberta-base' is a correct model identifier listed on 'https://huggingface.co/models'
or 'xlm-roberta-base' is the correct path to a directory containing a file named one of pytorch_model.bin, tf_model.h5, model.ckpt.
i create a new folder under the"C:\Users\Name.cache",name it"xlm-roberta-base",and I download the pytorch_model.bin to the folder,but still have error
The text was updated successfully, but these errors were encountered: