-
I have done an experiment training the vitstr_base model for "polish" vocab. The training has been performed using the following command:
I copied the checkpoint file for testing. Now I just like to use it for ocr for test purposes: reco_model = vitstr_base(pretrained=False, vocab="polish")
reco_model.from_pretrained(
f"{model_root_folder}FirstTrain.vl.0.0515268.pt",
map_location="cpu",
vocab="polish",
) I'm getting error message:
Please advise what I'm doing wrong. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
As expected the solution is trivial. The training script expects the name of the vocabulary e.g. "polish" The parameter vocab= expects not the name of the language but the actual string containing vocabulary. In my case VOCAB["polish"]. So the working code looks like: reco_model = vitstr_base(pretrained=False, vocab="polish")
reco_model.from_pretrained(
f"{model_root_folder}FirstTrain.vl.0.0515268.pt",
map_location="cpu",
vocab=VOCAB["polish"],
) |
Beta Was this translation helpful? Give feedback.
As expected the solution is trivial.
The training script expects the name of the vocabulary e.g. "polish"
The parameter vocab= expects not the name of the language but the actual string containing vocabulary. In my case VOCAB["polish"].
So the working code looks like: