A quick question about loading pretrained weight

#19
by iLOVE2D - opened

Hi, I find a problem about using pre-training weight:

OSError: You seem to have cloned a repository without having git-lfs installed. Please install git-lfs and run git lfs install followed by git lfs pull in the folder you cloned.

My code is:
model = BertForTokenClassification.from_pretrained(
"./Geneformer/", #I set this path the same as hugging face GitHub content.
num_labels=2,
output_attentions = False,
output_hidden_states = False
)
if freeze_layers is not None:
modules_to_freeze = model.bert.encoder.layer[:freeze_layers]
for module in modules_to_freeze:
for param in module.parameters():
param.requires_grad = False

model = model.to("cuda:0")

Could you please help me address it? Thanks a lot.

It appears that you need to install git-lfs on your system. https://git-lfs.com/

ctheodoris changed discussion status to closed

Hi, I am using a campus HPC, so I may not have the sudo right to install git lfs. Are there any alternative solutions? Thanks a lot.

iLOVE2D changed discussion status to open

Huggingface repositories use git lfs to handle large files such as datasets and large models. Here is some information on getting started with Huggingface repositories: https://huggingface.co/docs/hub/repositories-getting-started

You could consider asking the admin for your campus HPC to install git lfs. You could also separately download the model (for example, manually with the downward arrow next to file sizes in the repository) and then upload it to your campus system.

ctheodoris changed discussion status to closed

Sign up or log in to comment