Closed ahsimb closed 2 months ago
Referring to the previous example, it's worth noting that AutoModel.from_pretrained('gaunernst/bert-tiny-uncased')
returns an instance of the BertModel
class, while AutoModelForMaskedLM.from_pretrained('gaunernst/bert-tiny-uncased')
returns an instance of the BertForMaskedLM
class.
I created tickets to address these issues: #216, #217, #218, #219, #220, #221, #222.
Closing this issue, work will be done in the issues linked above.
Problem
Downloading a model and saving it locally using the following code loses the model specialization.
One way to verify this is to inspect the config.json file. For example, consider the gaunernst/bert-tiny-uncased model. Here is the beginning of its config.json file:
After running the above code for this model the config.json becomes like this:
A proper way of saving this model is by using a specialized model class, as in the code below.
When used correctly, this model should produce the output for the request
Similar to the following:
At the moment it returns gibberish.
Solution
Acceptance Criteria