### What this PR does / why we need it?
To fix ops test, where `model_config` has been set to `None` and doesn't
has `hf_config` attribute, we have added a check for `model_config` to
guarantee it is not `None_Type`.
cherry-pick from main:
https://github.com/vllm-project/vllm-ascend/pull/4384.
Signed-off-by: shen-shanshan <467638484@qq.com>