Sharding fails in TF when absolute scope was modified if `.` in layer name
# What does this PR do?

Fixes #18776, by taking care of the particular case of absolute scope modifications


## Who can review?


_The documentation is not available anymore as the PR was closed or merged._<|||||>Do you think we should add a special test for that @sgugger ? <|||||>On it! 🤗<|||||>Just added a test, RAG works, I think I'll try to test most of our models just to be sure that there is no other strange pattern. <|||||>Tested with `"openai/clip-vit-large-patch14",  "xlm-roberta-base"` in addition, works nicely. 