setMetadata function

Set metadata for a model